MyGit

pburtchaell/redux-promise-middleware

Fork: 189 Star: 1984 (更新于 2024-05-12 08:12:16)

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-05-18 07:41:34)

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-06-25 20:14:46 projectdiscovery/nuclei-templates

2024-06-22 08:38:28 sveltejs/svelte

2024-06-20 17:48:22 4ian/GDevelop

2024-06-18 06:07:40 langflow-ai/langflow

2024-06-15 01:21:11 serverless/serverless

2024-06-12 01:17:57 gchq/CyberChef