6.2.0 • Published 4 months ago

redux-promise-middleware v6.2.0

Weekly downloads
115,034
License
MIT
Repository
github
Last release
4 months ago

Redux Promise Middleware

npm downloads

Redux Promise Middleware enables simple, yet robust handling of async action creators in Redux.

const asyncAction = () => ({
  type: 'PROMISE',
  payload: new Promise(...),
})

Given a single action with an async payload, the middleware transforms the action to a separate pending action and a separate fulfilled/rejected action, representing the states of the async action.

The middleware can be combined with Redux Thunk to chain action creators.

const secondAction = (data) => ({
  type: 'SECOND',
  payload: {...},
})

const firstAction = () => {
  return (dispatch) => {
    const response = dispatch({
      type: 'FIRST',
      payload: new Promise(...),
    })

    response.then((data) => {
      dispatch(secondAction(data))
    })
  }
}

Documentation and Help

Heads Up: Version 6 includes some breaking changes. Check the upgrading guide for help.

Issues

For bug reports and feature requests, file an issue on GitHub.

For help, ask a question on StackOverflow.

Releases

For older versions:

Maintainers

Please reach out to us if you have any questions or comments.

Patrick Burtchaell (pburtchaell):

Thomas Hudspith-Tatham (tomatau):

License

Code licensed with the MIT License (MIT).

Documentation licensed with the CC BY-NC License.

frontplate-reduxproem-ui-developsample-teammreact-native-itablet@aliasliao/pat-commonmanage-app-testauth0-deploy-extensionsmanage-team-testskandreact-tailwind-typescriptcascnaplatformtestreact-redux-nightmare-quick-startcra-template-teemsly-starter@pyros2097/radthe-one-ring@infinitebrahmanuniverse/nolb-redux-p@oss-stealth/base@oss-stealth/paperdarch@everything-registry/sub-chunk-2640msg-odds-summary-femsg-odds-summary-fe-test-1escala-core@grindrodbank/spoon-ui@ethical-jobs/reduxfenestrojfeathers-starter-react-redux-loginfeathers-starter-react-redux-login-rolessession-messenger-nodejs@gdatabraid/github-widget2dynamic_step_coreethical-jobs-reduxscalable-react-boilerplateflavio-espinozaspaassy-reduxgabbrostagelightghn-sso@protonapp/proton-runnerjazasoft-mtdbjarvis-react-scripts@redhat-cloud-services/frontend-components-inventory-patchman@redhat-cloud-services/frontend-components-notifications@redhat-cloud-services/frontend-components-remediationsvoicebase-player-reactjrbotros-test-tentkinasekitcataloguevtracer-serversite-headersisatflocs-visual-components@kammy-ui/redux-store@juiceboxes/peargloo-jaeger-ui@modelo.io/apiui@modern-js-reduck/plugin-effectsthings-js-dashboardwebpack.redux.react.typescript.jestweb-modules-reduxweauthtwilio-frametwilio-frame-chatinsights-inventory-frontend@red-hat-insights/insights-frontend-componentstoukahtc-test-pussyfriends@meniga/reduxhapipresstenjin-mui-componentsgenji4rntremorylibrary@opendatateam/dataexplorer@yourwishes/nyce@vefacaglar/botframework-webchat-coremuseekslogin_ysxplorexm-entadmin-mainndtp-web1list-tablewebmotors.catalogo.ui@thehandsomepanther/brandibble-reduxmatrr-react-scriptsmikasa@teikei/map@tekpill/botframework-webchat-coreluna-applib-test-v1with-redux-wrappermardin@ubnt/unifi-led-ui@ubnt/unifi-talk-uiadmin-dashboardaljesusg_jaeger-ui@voicebase/react-player@webchattest/botframework-webchat-core@zef163/demo@types/redux-promise-middlewaremerchant-dashboard
6.2.0

4 months ago

6.1.3

2 years ago

6.1.2

4 years ago

6.1.1

5 years ago

6.1.0

5 years ago

6.0.1

5 years ago

6.0.1-beta.0

5 years ago

6.0.0

5 years ago

6.0.0-beta.0

5 years ago

5.1.1

6 years ago

5.1.0

6 years ago

5.0.0

6 years ago

4.4.2

6 years ago

4.4.1

7 years ago

4.4.0

7 years ago

4.3.0

7 years ago

4.2.1

7 years ago

2.5.0

7 years ago

4.2.0

7 years ago

4.1.0

8 years ago

4.0.0

8 years ago

3.3.2

8 years ago

3.3.1

8 years ago

3.3.0

8 years ago

3.2.0

8 years ago

3.1.0

8 years ago

3.0.2

8 years ago

3.0.1

8 years ago

2.4.0

8 years ago

3.0.0

8 years ago

2.3.3

8 years ago

2.3.2

8 years ago

2.3.1

8 years ago

2.3.0

8 years ago

2.2.4

8 years ago

2.2.3

8 years ago

2.2.2

8 years ago

2.2.1

8 years ago

2.2.0

8 years ago

2.1.1

8 years ago

2.1.0

8 years ago

2.0.0

8 years ago

1.0.0

9 years ago

0.2.2

9 years ago

0.2.1

9 years ago

0.2.0

9 years ago

0.1.0

9 years ago

0.0.1

9 years ago

0.0.0

9 years ago