December 2019
Intermediate to advanced
598 pages
12h 21m
English
The final task in Store.ts is to create a function that creates the store. Let's do this by carrying out the following steps:
import { Action, ActionCreator, Dispatch, Reducer, combineReducers, Store, createStore, applyMiddleware} from 'redux';import thunk, { ThunkAction } from 'redux-thunk';
export function configureStore(): Store<AppState> { const store = createStore( rootReducer, undefined, applyMiddleware(thunk) ); return store;}
This function uses the createStore function from Redux by passing in the combined reducers, undefined
Read now
Unlock full access