返回排行榜

pburtchaell/redux-promise-middleware

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

Enables robust, simple handling of async action creators in Redux

reduxasyncpromisesasync-functionsoptimistic-updates
Star 增长趋势
Star
2k
Forks
182
周增长
Issues
0
5001k1.5k
2023年2月2024年3月2025年5月2026年7月
制品库npmnpm install redux-promise-middleware
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):

相关仓库
reduxjs/redux

A JS library for predictable global state management

TypeScriptnpmMIT Licenseredux
redux.js.org
61.5k15.1k
pmndrs/zustand

🐻 Bear necessities for state management in React

TypeScriptnpmMIT Licensehooksreact
zustand-demo.pmnd.rs
58.4k2.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.6k10.5k
sudheerj/reactjs-interview-questions

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

JavaScriptnpmMIT Licensereactjsreact-router
44.7k10.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

JavaScriptnpmMIT Licenseimmutableimmutables
immerjs.github.io/immer/
29k879
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.

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

Official React bindings for Redux

TypeScriptnpmMIT Licensereactredux
react-redux.js.org
23.5k3.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

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

Normalizes nested JSON according to a schema

JavaScriptnpmMIT Licensenormalizrredux
20.8k858