官术网_书友最值得收藏!

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;
}
主站蜘蛛池模板: 平潭县| 阿克苏市| 海门市| 台湾省| 香格里拉县| 如皋市| 扎兰屯市| 建宁县| 杭锦旗| 阿坝| 定西市| 麻栗坡县| 保靖县| 建瓯市| 巴楚县| 巴中市| 保康县| 二手房| 弋阳县| 武穴市| 江油市| 建昌县| 丘北县| 阿合奇县| 灵璧县| 宾川县| 娄烦县| 永定县| 灵川县| 湟中县| 饶河县| 万载县| 鄢陵县| 德江县| 全南县| 惠安县| 原阳县| 晋江市| 莆田市| 定州市| 怀柔区|