MyGit

pburtchaell/redux-promise-middleware

Fork: 188 Star: 1982 (更新于 2024-11-09 05:44:12)

license: MIT

Language: JavaScript .

Enables simple, yet robust handling of async action creators in Redux

最后发布版本: 6.2.0 ( 2023-12-28 03:07:18)

官方网址 GitHub网址

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.

最近版本更新:(数据更新于 2024-10-04 00:10:17)

2023-12-28 03:07:18 6.2.0

2022-09-26 10:04:07 6.1.3

2019-11-06 01:08:18 6.1.2

2019-06-16 01:03:18 6.1.1

2019-02-14 09:43:59 6.1.0

2019-02-08 07:40:47 6.0.1

2019-02-04 04:04:10 6.0.0

2018-04-19 07:12:12 5.1.1

2018-04-18 21:44:48 5.1.0

2017-11-20 00:26:05 5.0.0

主题(topics):

async, async-functions, optimistic-updates, promises, redux

pburtchaell/redux-promise-middleware同语言 JavaScript最近更新仓库

2024-11-25 01:57:53 bia-pain-bache/BPB-Worker-Panel

2024-11-24 01:32:20 Number178/kikoeru-express

2024-11-23 05:56:23 pedroslopez/whatsapp-web.js

2024-11-22 22:33:12 ZeroRing233/Degrees-of-Lewdity-RobinMod

2024-11-22 16:46:00 meshery/meshery

2024-11-21 22:46:48 MHSanaei/3x-ui