Skip to content

Releases: klis87/redux-requests

redux-saga-requests-fetch v0.6.1

27 May 11:32
Compare
Choose a tag to compare

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

redux-saga-requests-axios v0.6.1

27 May 11:31
Compare
Choose a tag to compare

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

redux-saga-requests v0.12.1

05 Apr 16:17
Compare
Choose a tag to compare

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

16 Mar 18:19
Compare
Choose a tag to compare

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 into request 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

12 Mar 21:29
Compare
Choose a tag to compare

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 and redux-actions actions list to requestsReducer 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

11 Mar 16:22
Compare
Choose a tag to compare

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

08 Mar 10:27
Compare
Choose a tag to compare

Additional interceptor updates:

  • BREAKING: silent flag in sendRequest only stops actions from being dispatched, it doesn't affect interceptors

  • added runOnRequest, runOnSuccess, runOnError and runOnAbort flags to sendRequest to control whether an interceptor should be called, all default to true, useful to prevent endless loops when calling sendRequest inside an interceptor

  • BREAKING: changed return type of onError interceptor to match type of sendRequest, 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

06 Mar 18:22
Compare
Choose a tag to compare
  • improved interceptors:

    • passed request action to all interceptors as last argument
    • BREAKING: you have to return something in onRequest, onResponse and onError interceptors, for example request config with added header in onRequest, see interceptors in new docs
  • BREAKING: in order to mark dispatchRequestAction as true in sendRequest, 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 to sendRequest (like dispatchRequestAction), it tells sendRequest not to dispatch any action and not to call any interceptor, false as a default, useful inside interceptors

redux-saga-requests v0.7.0

05 Mar 21:30
Compare
Choose a tag to compare
  • added successAction, errorAction and abortAction to createRequestsInstance config to allow actions customization
  • BREAKING - renamed getSuccessAction, getErrorAction, getAbortAction to success, error, abort in requestsReducer for consistency
  • added requestsReducer config to its getData and getError
  • added "sideEffects": false to package.json for Webpack 4 tree-shaking

redux-saga-requests v0.6.0

28 Jan 12:00
Compare
Choose a tag to compare

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:

  • POTENTIALLY BREAKING: changed the way success, error, abort actions are structured, see actions and FSA in readme
  • added getError option to requestsReducer
  • added Actions and FSA blocks to readme