React Redux Thunk Middleware in Redux Toolkit for Async Actions with Axios
Offered By: Dave Gray via YouTube
Course Description
Overview
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
Related Courses
Software as a ServiceUniversity of California, Berkeley via Coursera Intro to Computer Science
University of Virginia via Udacity Web Development
Udacity Software Engineering for SaaS
University of California, Berkeley via Coursera CS50's Introduction to Computer Science
Harvard University via edX