Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

YouTube

React Redux Thunk Middleware in Redux Toolkit for Async Actions with Axios

Dave Gray via YouTube

Overview

Save Big on Coursera Plus. 7,000+ courses at $160 off. Limited Time Only!
Learn how to implement async actions using Redux Thunk middleware and Axios in Redux Toolkit. Explore the concept of thunks, create async thunks for fetching posts and users, and build a PostsExcerpt component. Discover how to handle loading states, dispatch async thunks at app load time, and create an addNewPost async thunk. Gain insights into adjusting initial state, adding extraReducers with builder cases, and avoiding common pitfalls when working with promises in Redux.

Syllabus

Intro
Welcome
Prerequisite knowledge
Faster Pace Ahead
What is a thunk?
Changing the initial state
Adjusting to the state shape
Creating a fetchPosts async thunk
Adding extraReducers and builder cases
Dispatching fetchPosts async thunk
Building a PostsExcerpt component
Displaying the loading state
Creating a fetchUsers async thunk
Dispatching fetchUsers at App load time
Creating an addNewPost async thunk
Dispatching the addNewPost async thunk
Quick Correction
Do not use try / catch blocks here as the video shows. You need the promise to be fulfilled or rejected which will have the appropriate response in the extraReducers.

Taught by

Dave Gray

Reviews

Start your review of React Redux Thunk Middleware in Redux Toolkit for Async Actions with Axios

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.