[Question] How do I dispatch multiple actions in one action?
See original GitHub issueHi.
Say I have one action initialize
, for this as for many actions I am dispatching an action:start
, action:success
and action:failure
. Most of these have counterparts in the reducers where they update properties like isFetching
, isSaving
, etc.
If I use redux-actions
instead of redux-thunk
then how do I let my reducers know the correct state at the correct time? If I can only dispatch one event at the end of one action then I can’t dispatch multiple actions/events from one action …
Issue Analytics
- State:
- Created 8 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Where to dispatch multiple actions in redux? - Stack Overflow
So, to answer the question, the right place to dispatch multiple actions is inside the click handler where the first action originates. Share....
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
Is there always a one-to-one mapping between reducers and actions? ... Should I dispatch multiple actions in a row from one action creator?...
Read more >React Redux: performance considerations when dispatching ...
By default, React will re-render once for each dispatched action, including for actions that are dispatched together in the same tick of the ......
Read more >Chaining Asynchronous Dispatches in Redux Toolkit - YouTube
In this video I cover how we can correctly dispatch one action after another, where the second dispatch is informed by the state...
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
redux-thunk
is a middleware unlikeredux-actions
which is a utility library for creating and handling actions. So you can still continue to useredux-thunk
to dispatch multiple actions and useredux-actions
API tocreateAction
andhandleActions
like:action.js
reducers.js
@addnab Thank you , This is good solution.