diff --git a/docs/Basics/Getting Started.md b/docs/Basics/Getting Started.md index 68a3ec3843..0cb73c8981 100644 --- a/docs/Basics/Getting Started.md +++ b/docs/Basics/Getting Started.md @@ -181,25 +181,28 @@ import todos from '../reducers/todos'; const store = createStore(todos); ``` -Usually you’ll have multiple reducers for different domains of data in your app. You can use the `combineReducers()` helper to combine multiple reducers into one: +Usually you’ll have multiple reducers for different domains of data in your app. Consider the following reducers: ```js -import { createStore, combineReducers } from 'redux'; -import * as reducers from '../reducers'; -const reducer = combineReducers(reducers); -const store = createStore(reducer); +export function todos(state, action) { + /* ... */ +} + +export function counter(state, action) { + /* ... */ +} ``` -For example, if the object passed to `combineReducers()` looks like this: +You can use the `combineReducers()` helper to combine multiple reducers into one: ```js -const reducers = { - todos: todoReducer, - counter: counterReducer -}; +import { createStore, combineReducers } from 'redux'; +import * as reducers from '../reducers'; +const reducer = combineReducers(reducers); +const store = createStore(reducer); ``` -It will create a reducer which produces a state object like this: +It will create a reducer which produces a state object, whose keys are match those of your reducers: ```js const state = {