标签:
Previous, we do composition with objects:
const todoApp = (state = {}, action) => { return { todos: todos( state.todos, action ), visibilityFilter: visibilityFilter( state.visibilityFilter, action ) }; };
Since it is common options in Redux, there is a function call ‘combineReducers‘:
const {combineReducers} = Redux; combineReducers({ todos, //ES6 shortcut syntax visibilityFilter });
[Redux] Reducer Composition with combineReducers()
标签:
原文地址:http://www.cnblogs.com/Answer1215/p/5065436.html