Dispatching multiple actions in an action creator
See original GitHub issueWhat is the recommended way of doing something like this? Using redux-thunk, you receive dispatch
in your thunk, but with this middleware, i’m not sure how i’d go about getting access to the dispatch method in my action creators. Sorry if i’m just missing something obvious.
Issue Analytics
- State:
- Created 8 years ago
- Reactions:2
- Comments:13
Top Results From Across the Web
Where to dispatch multiple actions in redux? - Stack Overflow
The action creator is the correct location for dispatching multiple actions. Although code like the following would work:
Read more >Can I dispatch multiple actions from Redux action creators?
So it is OK to dispatch multiple actions from an action creator? Yes! There is absolutely nothing wrong with doing so. Don't worry,...
Read more >Redux FAQ: Actions
How do you decide between thunks, sagas, observables, or something else? Should I dispatch multiple actions in a row from one action creator?...
Read more >Javascript: Redux: Dispatching Multiple Actions - Medium
The answer of course is, yes, just either call dispatch multiple times or iterate dispatch over an array. Usually, though, if you're dispatching...
Read more >Multiple Actions | React Redux Tutorial for Beginners in Hindi
Can I dispatch multiple actions from Redux action creators ?Follow Tutorials website:FB: https://www.facebook.com/tutorialswebsiteWebsite: ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Guys, I managed to get it work by using the Promise.all() method. Check the example below:
Hope it helps!
Try this one:
It uses redux-thunk , redux-actions and redux-promise I believe this is what you originally wanted @ashaffer