Skip to content

Releases: klis87/redux-requests

redux-saga-requests-fetch v0.9.0

15 Aug 18:35
Compare
Choose a tag to compare

Internal refactoring, see more info in redux-saga-requests v0.16.0 release.

redux-saga-requests-axios v0.7.0

15 Aug 18:34
Compare
Choose a tag to compare

Internal refactoring, see more info in redux-saga-requests v0.16.0 release.

redux-saga-requests-fetch v0.8.0

22 Jul 16:43
Compare
Choose a tag to compare

Added an optional AbortController support, so fetch request can be trully aborted - previously aborts were just ignored and only abort action was dispatched.

To use it, just pass AbortController class to createRequestInstance, like:

yield createRequestInstance(
    window.fetch,
    {
      driver: fetchDriver,
      baseURL: 'https://my-domain.com',
      AbortController: window.AbortController, // or a ponyfill
    },
  );

redux-saga-requests-fetch v0.7.0

15 Jul 17:57
Compare
Choose a tag to compare

Now streams are automatically read and saved as response.data, so you never need to use response methods like response.json(), response.blob() etc. This is also done for error instances.

Also, added responseType null option, which is useful for responses with no body, like with 204 status code, for which response.json() would fail, or when you don't care about a response body - then it could you some milliseconds as a json parse won't be done in vain. For example:

const fetchEmptyBody = () => ({ 
  type: 'FETCH_EMPTY_BODY',
  request: {
    url: '/endpoint',
    responseType: null,
  },
});

redux-saga-requests v0.15.0

14 Jul 17:39
Compare
Choose a tag to compare

Added possibility to define takeLatest in watchRequest as function action => boolean.

Also (BREAKING), above enhancement has been used to change takeLatest default - before it was set to true for all requests, now it depends on request's method - GET requests use takeLatest true, the rest ones use takeLatest false. Usually this is what you need. Most often you are only interested in the latest response of read only GET requests. However, for side effect requests, like POST, for example when adding a new comment, you will need to react to all new comment responses, otherwise you could miss some updates. If you don't like it, you can always provide your own takeLatest implementation in watchRequests config.

redux-saga-requests v0.14.0

08 Jul 14:54
Compare
Choose a tag to compare

BREAKING - requestsPromiseMiddleware doesn't promisify all requests actions automatically anymore. Now you have to add meta.asPromise to request actions, for example:

const requestAction = {
  type: 'FETCH_STH',
  request: { url: '/sth' },
  meta: { asPromise: true },
};

If you with to revert to previous behaviour, pass auto: true to requestsPromiseMiddleware:

requestsPromiseMiddleware({ auto: true });

Big thanks to @mowbell for the idea.

redux-saga-requests v0.13.2

02 Jul 14:48
Compare
Choose a tag to compare

Fixed a crash when an action had a structure { type: 'TYPE': payload: null }, thanks to @EvgeneOskin!

redux-saga-requests v0.13.1

28 Jun 20:53
Compare
Choose a tag to compare

Fixed bug when using Axios driver - action with request error was incorrectly interpret as a request. There was a similar issue #101 already solved, but it exluded response errors, it didn't consider potential request error, due to lack of internet connection for instance. Details can be seen in #133. Big thanks to @nemosupremo for spotting and fixing this issue!

redux-saga-requests v0.13.0

27 May 16:47
Compare
Choose a tag to compare

A small change of default onRequest handler in requestsReducer - it doesn't touch data anymore, it only resets error and updates pending counter.

redux-saga-requests v0.12.2

27 May 11:32
Compare
Choose a tag to compare

Reduced bundle size thanks to upgrade to Webpack 4 (only for UMD build).