Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

License

NotificationsYou must be signed in to change notification settings

pburtchaell/redux-promise-middleware

npm downloads

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

constasyncAction=()=>({type:'PROMISE',payload:newPromise(...),})

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 withRedux Thunk to chain action creators.

constsecondAction=(data)=>({type:'SECOND',payload:{...},})constfirstAction=()=>{return(dispatch)=>{constresponse=dispatch({type:'FIRST',payload:newPromise(...),})response.then((data)=>{dispatch(secondAction(data))})}}

Documentation and Help

Heads Up: Version 6 includes some breaking changes. Check theupgrading 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.

About

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

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors47


[8]ページ先頭

©2009-2025 Movatter.jp