Releases: klis87/redux-requests
redux-saga-requests-fetch v0.6.1
Reduced bundle size thanks to upgrade to Webpack 4 (only for UMD build).
redux-saga-requests-axios v0.6.1
Reduced bundle size thanks to upgrade to Webpack 4 (only for UMD build).
redux-saga-requests v0.12.1
Fixed bug when using Axios
driver with FSA actions - error
action was incorrectly interpret as a request, because request
key in error
actions in payload
was set by Axios
, which collided with request
key from this library. Details can be seen in #101. Great thanks to @qizmaster for fixing this!
redux-saga-requests v0.12.0
Added an optional requestsPromiseMiddleware
, which promisifies request actions so you can wait for them to resolve from React components - see README for more info.
Apart from this:
BREAKING
- standardized request action structure - previously it was{ type: 'A_TYPE', request: {} }
or{ type: 'A_TYPE', requests: [{}, {}] }
, now batched request also go intorequest
key -{ type: 'A_TYPE', request: [{}, {}] }
- fixed UMD bundle - removed
redux-saga
from the bundle, which was there due to Webpack misconfiguration
redux-saga-requests v0.11.0
This is quite an important release, focusing on making watchRequests
configurable. Before, watchRequests
wasn't flexible and powerful enough to support requests aborts, so lower level sendRequest
was necessery then. From now on, watchRequests
should be enough to handle aborts as well, so everyone can switch to auto mode with watchRequests
, which will greatly simplify sagas. See updated docs for more details.
Apart from this, following updates were made:
- allowed passing
redux-act
andredux-actions
actions list torequestsReducer
resetOn
- now resetHandler in
requestsReducer
doesn't touch pending counter - before subtle counter bugs could happen during requests aborts - fixed error payload in error actions - wrong error object was passed
redux-saga-requests v0.10.0
Added resetOn
to requestsReducer
config. Useful to reset state in your reducers easily. One nice possibility is to create your own requestsReducer
with a global behaviour, for example:
const myRequestsReducer = createRequestsReducer({ resetOn: ['LOGOUT'] });
// or const myRequestsReducer = createRequestsReducer({ resetOn: action => action.type === 'LOGOUT' });
Now, with 1 line of code, all your requests reducers will restart their state to initial one on user logout.
Of course, you can pass resetOn
to each requestsReducer
independently, which will overwrite global resetOn
(if defined).
redux-saga-requests v0.9.0
Additional interceptor updates:
-
BREAKING
:silent
flag insendRequest
only stops actions from being dispatched, it doesn't affect interceptors -
added
runOnRequest
,runOnSuccess
,runOnError
andrunOnAbort
flags tosendRequest
to control whether an interceptor should be called, all default totrue
, useful to prevent endless loops when callingsendRequest
inside an interceptor -
BREAKING
: changed return type ofonError
interceptor to match type ofsendRequest
, now you must return{ response: someResponse }
or{ error: someError }
, this change was made to allow shortcut like this:function* onErrorSaga(error, action) { if (weCanTryToRetry(error)) { return yield call(sendRequest, action, { silent: true, runOnError: false }); } return { error } }
redux-saga-requests v0.8.0
-
improved interceptors:
- passed request action to all interceptors as last argument
BREAKING
: you have to return something inonRequest
,onResponse
andonError
interceptors, for example request config with added header inonRequest
, seeinterceptors
in new docs
-
BREAKING
: in order to markdispatchRequestAction
astrue
insendRequest
, you need to:yield call( sendRequest, action, { dispatchRequestAction: true }, );
instead of
yield call(sendRequest, action, true);
-
new flag
silent
which you can pass in config tosendRequest
(likedispatchRequestAction
), it tellssendRequest
not to dispatch any action and not to call any interceptor,false
as a default, useful inside interceptors
redux-saga-requests v0.7.0
- added
successAction
,errorAction
andabortAction
tocreateRequestsInstance
config to allow actions customization BREAKING
- renamedgetSuccessAction
,getErrorAction
,getAbortAction
tosuccess
,error
,abort
inrequestsReducer
for consistency- added
requestsReducer
config to itsgetData
andgetError
- added
"sideEffects": false
topackage.json
for Webpack 4 tree-shaking
redux-saga-requests v0.6.0
From this version this mono repo switches to independend Lerna mode - this means that when 2 packages are updated at the same time, they could be updated to a different version.
Regarding updates for redux-saga-requests
package: