Skip to content

Releases: klis87/redux-requests

redux-saga-requests-fetch v0.10.0

22 Mar 16:13
Compare
Choose a tag to compare

See redux-saga-requests v0.27.0

redux-saga-requests-axios v0.8.0

22 Mar 16:14
Compare
Choose a tag to compare

See redux-saga-requests v0.27.0

redux-saga-requests-react v0.2.1

06 Sep 13:06
Compare
Choose a tag to compare

Fixed incorrect useMemo dependencies array in useQuery and useMutation, which could cause some update issues on prop changes or PureComponent optimisations.

redux-saga-requests v0.26.0

01 Sep 11:18
Compare
Choose a tag to compare

This is a very big release related to new networkReducer, which is a manager of requestsReducers, so you won't need to write reducers for remote state anymore. Its introducing was followed with below changes:

  • introduced concept of queries and mutations (old operations), queries are requests which fetch data like GET requests, mutations can change data and usually they use methods like POST, PUT, DELETE, PATCH
  • removed redundant createRequestsReducer as you could just create requestsReducer wrapper with functional programming technique
  • removed possibility to merge requestsReducer with a custom reducer, just use a separate reducer instead and merge them with selectors if needed
  • added local mutations (previously we would call them as local operations), so that you can update data with ordinary actions, not only request ones
  • added networkReducer which you can read about in the docs, I recommend to use it as probably requestsReducer will be removed in future versions
  • added getQuery and getMutation selector creators, useful especially with networkReducer, so you don't need to write selectors for your remote data manually, it requires reselect 4 as peer dependency so make sure you have it installed

redux-saga-requests-react v0.2.0

01 Sep 11:04
Compare
Choose a tag to compare

Changes too big to mentioned here, but related to redux-saga-requests update to 0.26.0. So only update redux-saga-requests-react to 0.2.0 only if you upgraded redux-saga-requests to 0.26.0. Please refer docs to see how new API looks like, but we could sum up changes in the following points:

  • renamed Operation into Mutation and RequestContainer into Query to match core library naming convention
  • added React hooks useQuery and useMutation
  • removed connected components versions as Query and Mutation are connected by default

redux-saga-requests-graphql v0.2.0

01 Sep 10:58
Compare
Choose a tag to compare

Added headers support, useful especially for authentication.

redux-saga-requests v0.25.0

23 Jun 19:27
Compare
Choose a tag to compare

Added server side rendering support with countServerRequests and serverRequestsFilterMiddleware.

redux-saga-requests v0.24.1

12 May 16:25
Compare
Choose a tag to compare

Performance and memory usage optimizations in requestsReducer. Thanks @megawac !

redux-saga-requests v0.24.0

06 Apr 16:25
Compare
Choose a tag to compare

Improved cache support, namely added possibility to define cacheKey and cacheSize next to cache in action meta, which allows to keep separate caches within the same request type per defined key. For instance:

const fetchBook = id => ({
  type: FETCH_BOOK,
  request: { url: `/books/${id}`},
  meta: {
    cache: true,
    cacheKey: id, // must be string
    cacheSize: 2 // optional with defined cacheKey to avoid cache growing too big
  },
});

To achieve caching per key, internal caching implementation had to be changed a little, so in contract to previous version, now request and response actions are dispatched even when there is cache hit. Probably it won't affect you, but it might be useful to know. At the same time, sendRequest will also return success response from cache, no { cacheHit: true } object.

There is another small change regarding success action structure, namely now the whole server response is added to action, not only data, for instance:

{
  type: 'DELETE_BOOK_SUCCESS',
  response: { data: 'some data' },
  data: 'some data',
  meta: {
    id: 1, // got from request action meta
    requestAction: {
      type: 'DELETE_BOOK',
      request: {
        url: '/books/1',
        method: 'delete'
      },
      meta: {
        id: 1,
      },
    },
  },
}

redux-saga-requests v0.23.1

14 Mar 16:23
Compare
Choose a tag to compare

Allow using any action in resetOn of requestsReducer. Previously you couldn't use request action (which u pass to actionType, or any response matching action (success, error, or abort), because reset case returned earlier, so request/response logic wasn't even executed.

Thanks to @megawac for the idea and PR!