Skip to content

Latest commit

 

History

History

withPostFetch

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

withPostFetch

The withPostFetch injector allows to inject behaviour after the service call, regardless of the response status. This injector doesn't override any of the success-failure pattern behavior, which means that the ${action.target}Loading and ${action.target}Error will still be changed accordingly (unless you set a different behaviour using other injectors). This injector is not thought for normalizing/denormalizing data. If this is the intention, successSelector can be used instead.

Example:

  import { withPostFetch } from 'redux-recompose';

  const actionCreators = {
    someAction: data => ({
      type: actionType,
      target: someTarget,
      service: someService,
      payload: data,
      injections: [
        withPostFetch((dispatch, response) => {
          ...
        });
      ]
    })
  };