August 2017
Beginner
298 pages
7h 4m
English
The last stage of working with the Redux part is to create the store object using the root reducer. Inside the redux/store directory, create the configureStore.js file, which will create our store object. We will also need to apply our redux-thunk middleware in this file, which will allow us to use actions that will dispatch other actions.
Redux provides the createStore function to create the store object and the applyMiddleware function to add middleware. In your configureStore.js file, add the following code:
import { createStore, applyMiddleware } from 'redux';import thunk from 'redux-thunk';import rootReducer from '../reducers/rootReducer';
To create a store, you will simply need to call the createReducer function with rootReducer ...
Read now
Unlock full access