来源 Redux作者入门教程
js 简单实现
const combineReducers = (reducers) =>{
return (state = {}, action) =>{
return Object.Keys(reducers).reduce(
(nextState, key) =>{
nextState[key] = reducers[key](
state[key],
action
);
return nextState;
}, {})
};
};