- Redux Quick Start Guide
- James Lee Tao Wei Suresh Kumar Mukhiya
- 70字
- 2021-07-02 12:40:32
Configuring the store
Since we know what a store is in Redux, let's get started with creating a store file. We can keep our store in a separate file. Let's call it configureStore.js:
import { createStore, applyMiddleware, compose } from "redux";
import createReducer from "./reducers";
export default function configureStore(initialState = {}, history) {
const store = createStore(
createReducer(),
);
// Extensions
store.injectedReducers = {}; // Reducer registry
return store;
}