pburtchaell/redux-promise-middleware

JavaScriptpburtchaell.gitbook.io/redux-promise-middleware/

Enables robust, simple handling of async action creators in Redux

reduxasyncpromisesasync-functionsoptimistic-updates
Star Growth
Stars
2k
Forks
182
Weekly Growth
+-1
Issues
0
5001k1.5k
Feb 2023Apr 2024Jun 2025Sep 2026
Artifactsnpm
README

Redux Promise Middleware

npm version npm downloads license

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):

Related repositories
reduxjs/redux

A JS library for predictable global state management

TypeScriptnpmlibraryMIT Licenseredux
redux.js.org
61.5k15.2k
pmndrs/zustand

🐻 Bear necessities for state management in React

TypeScriptnpmMIT Licensehooksreact
zustand-demo.pmnd.rs
58.7k2.2k
Asabeneh/30-Days-Of-JavaScript

30 days of JavaScript programming challenge is a step-by-step guide to learn JavaScript programming language in 30 days. This challenge may take more than 100 days, please just follow your own pace. These videos may help too: https://www.youtube.com/channel/UC7PNRuno1rzYPb1xLa4yktw

JavaScriptnpm30daysofjavascriptjavascript-for-everyone
46.8k10.5k
sudheerj/reactjs-interview-questions

List of top 500 ReactJS Interview Questions & Answers....Coding exercise questions are coming soon!!

JavaScriptnpminterviewMIT Licensereactjsreact-router
44.8k10.4k
react-boilerplate/react-boilerplate

🔥 A highly scalable, offline-first foundation with the best developer experience and a focus on performance and best practices.

JavaScriptnpmMIT Licensereactreact-boilerplate
reactboilerplate.com
29.5k6k
immerjs/immer

Create the next immutable state by mutating the current one

JavaScriptnpmlibraryMIT Licenseimmutableimmutables
immerjs.github.io/immer/
29k883
Asabeneh/30-Days-Of-React

30 Days of React challenge is a step by step guide to learn React in 30 days. These videos may help too: https://www.youtube.com/channel/UC7PNRuno1rzYPb1xLa4yktw

JavaScriptnpmchallengejavascript
27.5k7.7k
responsively-org/responsively-app

A modified web browser that helps in responsive web development. A web developer's must have dev-tool.

TypeScriptnpmappGNU Affero General Public License v3.0web-developmentresponsive
responsively.app
25.2k1.4k
reduxjs/react-redux

Official React bindings for Redux

TypeScriptnpmMIT Licensereactredux
react-redux.js.org
23.4k3.3k
markerikson/react-redux-links

Curated tutorial and resource links I've collected on React, Redux, ES6, and more

reactredux
22.5k2.5k
redux-saga/redux-saga

An alternative side effect model for Redux apps

JavaScriptnpmlibraryMIT Licensereduxsagas
redux-saga.js.org
22.4k1.9k
paularmstrong/normalizr

Normalizes nested JSON according to a schema

JavaScriptnpmlibraryMIT Licensenormalizrredux
20.8k856