- 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;
}
推薦閱讀
- Learn ECMAScript(Second Edition)
- Apache ZooKeeper Essentials
- Objective-C Memory Management Essentials
- 高效微控制器C語言編程
- Cocos2d-x游戲開發:手把手教你Lua語言的編程方法
- Apache Spark 2.x Machine Learning Cookbook
- Java從入門到精通(第4版)
- Mastering Scientific Computing with R
- C程序設計案例教程
- 快速念咒:MySQL入門指南與進階實戰
- ASP.NET程序設計教程
- Visual C#.NET程序設計
- 運維前線:一線運維專家的運維方法、技巧與實踐
- SQL Server 2016 從入門到實戰(視頻教學版)
- 區塊鏈架構之美:從比特幣、以太坊、超級賬本看區塊鏈架構設計