Skip to content

Update ordering or things #336

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 27, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 14 additions & 11 deletions docs/Basics/Getting Started.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down