- 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;
}
推薦閱讀
- Android Jetpack開發(fā):原理解析與應(yīng)用實(shí)戰(zhàn)
- Learn Type:Driven Development
- Cocos2d-x游戲開發(fā):手把手教你Lua語言的編程方法
- Mastering Selenium WebDriver
- TestNG Beginner's Guide
- Python GUI Programming Cookbook
- EPLAN實(shí)戰(zhàn)設(shè)計(jì)
- Create React App 2 Quick Start Guide
- Learning PHP 7
- Node.js 12實(shí)戰(zhàn)
- Xcode 6 Essentials
- PHP與MySQL權(quán)威指南
- Tableau Desktop可視化高級(jí)應(yīng)用
- Swift High Performance
- Python 3.6從入門到精通(視頻教學(xué)版)