庞大的前端项目该如何根据feature处理store

2017-11-28  本文已影响80人  张培_

情景补充1

情景补充2

解决方案一

因此尝试采用一个feature一个reducer

解决方案二(最优)

//feature1
const feature1 = combineReducers({
    c1: c1Reducer,
    c2: c1Reducer
})

//feature2
const feature2 = combineReducers({
    c1: c1Reducer,
    c2: c1Reducer
})

//store
const store = combineReducers({
    feature1:feature1
    feature2:feature2
})

优点

上一篇下一篇

猜你喜欢

热点阅读