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

  • 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;
}
主站蜘蛛池模板: 黑龙江省| 城步| 东乌珠穆沁旗| 邻水| 乡宁县| 古蔺县| 仙桃市| 巴彦县| 九江市| 嘉祥县| 高邮市| 盐山县| 阳曲县| 兴化市| 宝清县| 剑阁县| 万源市| 绥中县| 日土县| 齐齐哈尔市| 白城市| 百色市| 遂昌县| 兴安县| 阳江市| 惠水县| 泉州市| 伊通| 方正县| 达拉特旗| 吉林市| 且末县| 绩溪县| 潜山县| 沧州市| 辉县市| 沿河| 庆安县| 永平县| 喜德县| 浙江省|