Redux学习笔记------store

store是用来干什么的?

Redux 应用只有一个单一的 store。当需要拆分数据处理逻辑时,应该使用 reducer 组合而不是创建多个 store。

1.createStore()

import { createStore } from 'redux'
import todoApp from './reducers'
let store = createStore(todoApp)


let store = createStore(todoApp, window.STATE_FROM_SERVER)

第二个参数用来设置state的初始状态

原文地址:https://www.cnblogs.com/pengshuo/p/6640763.html