Skip to content

Instantly share code, notes, and snippets.

@StevenJL
Last active March 20, 2017 22:48
Show Gist options
  • Save StevenJL/c5639cb2805dcf4affb2 to your computer and use it in GitHub Desktop.
Save StevenJL/c5639cb2805dcf4affb2 to your computer and use it in GitHub Desktop.
import { combineReducers } from 'redux'
// creating a composite reducer with constitute reducers via
// the `combineReducers` method.
const todoApp = combineReducers({
visibilityFilter,
todos,
})
// The above is equivalent to this
function todoApp(state, action) = {
return {
visibilityFilter: visibilityFilter(state.visibilityFilter, action),
todos: todos(state.todos, action)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment