In this video I cover how we can correctly dispatch one action after another, where the second dispatch is informed by the state changes from the first. This is doable if you can "calculate" what your next state will be. If it is entirely asynchronous, however, then we need to get clever. Enter Redux Thunks via createAsyncThunk provided to us by Redux Toolkit! We can then set up some thunks to daisy chain asynchronous dispatches.
Link to the video where I build a quick Redux Toolkit Implementation if you need a crash course in it:
• How to Persist Redux State to an API ...
Link to starting boilerplate code for the video:
https://github.com/przekwas/daisy-cha...
Don't forget to like this video and subscribe to our channel – we're publishing more videos and walkthroughs every week. Comment below and let us know what you'd like to see next!
Join the Covalence community: https://covalence.io
Shop Covalence merch: https://covalence.merchntly.com
Watch video Chaining Asynchronous Dispatches in Redux Toolkit online without registration, duration hours minute second in high quality. This video was added by user Covalence 22 August 2022, don't forget to share it with your friends and acquaintances, it has been viewed on our site 5,795 once and liked it 116 people.