8000 GitHub - JobbyM/jianshu
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

JobbyM/jianshu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react全家桶简书

使用immutable.js来管理store中的数据

1.使用npm i immutable 进行安装 2.immutable对象的set方法,会结合之前immutable对象的值和设置的值,返回一个全新的对象

使用redux-immutable统一数据格式

1.使用npm i redux-immutable 进行安装 2.使得mapStateToProps 中的state 也成为immutable对象

// 之前
state.header.getIn('focuse')
// 之后
state.getIn(['header', 'focuse'])

3.修改src/store/reducer.js 文件,将combineReducers 的引入进行修改

// 之前
import { combineReducers } from 'redux'
// 之后
import { combineReducers } from 'redux-immutable'

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0