1. 16
    Dispatch Asynchronous Actions with Redux Thunk Middleware
    8m 29s

Dispatch Asynchronous Actions with Redux Thunk Middleware

Andy Van Slaars
InstructorAndy Van Slaars
Share this video with your friends

Social Share Links

Send Tweet
Published 7 years ago
Updated 5 years ago

In this lesson, we’ll be retrieving data from the server as well as posting new data to the server using fetch. We’ll make this work with Redux using the Thunk Middleware which will allow us to dispatch asynchronous actions.

Joseph Cooper
Joseph Cooper
~ 7 years ago

Weird, I've been following this tutorial to a T yet I'm getting an error stating that res is not defined in the todoServices file. I'm still a bit of a noob to async code, any idea why this might be occurring?

José Tapadas Alves
José Tapadas Alves
~ 6 years ago

Please notice that you need to import the thunk differently:

import { createStore, applyMiddleware } from 'redux';
import thunkMiddleware from 'redux-thunk';
import reducer from './reducers/todo';

export default createStore(reducer, applyMiddleware(thunkMiddleware));
Markdown supported.
Become a member to join the discussionEnroll Today