Releases: klis87/redux-requests
redux-saga-requests-fetch v0.10.0
See redux-saga-requests v0.27.0
redux-saga-requests-axios v0.8.0
See redux-saga-requests v0.27.0
redux-saga-requests-react v0.2.1
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
This is a very big release related to new networkReducer
, which is a manager of requestsReducer
s, 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
likeGET
requests, mutations can changedata
and usually they use methods likePOST
,PUT
,DELETE
,PATCH
- removed redundant
createRequestsReducer
as you could just createrequestsReducer
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 probablyrequestsReducer
will be removed in future versions - added
getQuery
andgetMutation
selector creators, useful especially withnetworkReducer
, so you don't need to write selectors for your remote data manually, it requiresreselect 4
as peer dependency so make sure you have it installed
redux-saga-requests-react v0.2.0
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
intoMutation
andRequestContainer
intoQuery
to match core library naming convention - added React hooks
useQuery
anduseMutation
- removed connected components versions as
Query
andMutation
are connected by default
redux-saga-requests-graphql v0.2.0
Added headers
support, useful especially for authentication.
redux-saga-requests v0.25.0
Added server side rendering support with countServerRequests
and serverRequestsFilterMiddleware
.
redux-saga-requests v0.24.1
Performance and memory usage optimizations in requestsReducer
. Thanks @megawac !
redux-saga-requests v0.24.0
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
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!