Skip to content

Releases: redux-saga/saga-query

v9.0.2

15 Sep 15:06
6e748f8
Compare
Choose a tag to compare

v9.0.1

15 Sep 02:57
5151d13
Compare
Choose a tag to compare

Full Changelog: v9.0.0...v9.0.1

v9.0.0

12 Sep 14:45
a9c7307
Compare
Choose a tag to compare

What's Changed

  • feat: export resetLoaders action by @ElForastero in #33
  • fix: dont automatically set content type for fetcher()
  • BREAKING CHANGE: headersMdw from fetcher() is now opt-in

New Contributors

Full Changelog: v8.0.0...v9.0.0

ctx.loader no longer requires `id`

02 Aug 20:00
10451a4
Compare
Choose a tag to compare

invalidate cache mechanism

02 Aug 19:19
6f4230b
Compare
Choose a tag to compare

properly memoize react hooks

01 Aug 15:23
85ccca3
Compare
Choose a tag to compare
v7.2.2

fix: memoize react hooks properly

ensure support `yield* next()`

25 Jun 19:09
e6461db
Compare
Choose a tag to compare
v7.2.1

chore: ensure `yield* next()` works as expected

`fetchRetry` middleware

21 Feb 03:29
8ce5257
Compare
Choose a tag to compare
feat(fetcher): retry middleware (#29)

A new middleware for retrying fetch requests when `response.ok` is
`false`.  This middleware was designed to work on a per-endpoint basis.
This means that it should be added immediately after the endpoint
function.

```
import { createApi, requestMonitor, fetcher, fetchRetry } from
'saga-query';
const api = createApi();
api.use(requestMonitor());
api.use(api.routes());
api.use(fetcher());

const fetchUsers = api.get('/users', [
    function* (ctx, next) {
        // ...
        yield next();
        // ...
    },
    fetchRetry(),
])
```

It also supports a backoff function as a parameter.  The function
signature is `(attempt: number) => number`, the result of which is how
long to delay the next fetch attempt.  If a negative number is provided
then we stop retrying.

Ability to represent any body format for `Response()`

15 Feb 15:40
0476579
Compare
Choose a tag to compare

This release makes it possible to represent the body of Response() in any supported format by the Fetch API.

const fetchUsers = api.get('/users', function*(ctx, next) {
  ctx.bodyType = 'text'; // calls `Response.text()` instead of default `Response.json()`
  yield next();
});

typed-redux-saga

10 Feb 19:48
6cd8dd9
Compare
Choose a tag to compare

This is a breaking change for anyone using saga-query. We are now using typed-redux-saga which means anytime you import effects (e.g. call, select, put, etc.) from saga-query you must use yield delegates.

Before

import { call } from 'saga-query';

function* gen() {
  return 0;
}

function*() {
  // ts considers result is `any`
  const result = yield call(gen);
}

After

import { call } from 'saga-query';

function* gen() {
  return 0;
}

function*() {
  // ts considers result is `number`
  const result = yield* call(gen);
}