[Redux] Reducer Composition with combineReducers()
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 });