October 2019
Intermediate to advanced
426 pages
11h 49m
English
In order for us to be able to use asynchronous action creator functions in Redux, we are going to need to load the redux-thunk middleware. This middleware checks if an action creator returned a function, rather than a plain object, and if that is the case, it executes that function, while passing the dispatch function to it as an argument.
Let's adjust the store to allow for asynchronous action creators now:
import { createStore, applyMiddleware } from 'redux'
import thunk from 'redux-thunk'import appReducer from './reducers'
Read now
Unlock full access