- Notifications
You must be signed in to change notification settings - Fork186
Enables simple, yet robust handling of async action creators in Redux
License
pburtchaell/redux-promise-middleware
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
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))})}}
Heads Up: Version 6 includes some breaking changes. Check theupgrading guide for help.
For bug reports and feature requests,file an issue on GitHub.
For help,ask a question on StackOverflow.
For older versions:
Please reach out to us if you have any questions or comments.
Patrick Burtchaell (pburtchaell):
Thomas Hudspith-Tatham (tomatau):
About
Enables simple, yet robust handling of async action creators in Redux
Topics
Resources
License
Code of conduct
Contributing
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.