You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/api/combineReducers.md
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
1
# `combineReducers(reducers)`
2
2
3
-
As your app grows more complex, you’ll want to split your [reducing function](../Glossary.md#reducer) into separate different functions managing independent parts of the [state](../Glossary.md#state).
3
+
As your app grows more complex, you’ll want to split your [reducing function](../Glossary.md#reducer) into separate functions, each managing independent parts of the [state](../Glossary.md#state).
4
4
5
-
This helper turns an object whose values are different reducing functions into a single
5
+
The `combineReducers`helper function turns an object whose values are different reducing functions into a single
6
6
reducing function you can pass to [`createStore`](createStore.md).
7
7
8
8
The resulting reducer calls every child reducer, and gather their results into a single state object. The shape of the state object matches the keys of the passed `reducers`.
@@ -13,7 +13,7 @@ The resulting reducer calls every child reducer, and gather their results into a
13
13
14
14
#### Arguments
15
15
16
-
1.`reducer` (*Object*): An object whose values correspond to different reducing functions that need to be combined into one. One handy way to obtain it is to use ES6 `import * as reducers` syntax, but you can also construct this object manually. See the notes below for some rules every passed reducer must follow.
16
+
1.`reducers` (*Object*): An object whose values correspond to different reducing functions that need to be combined into one. One handy way to obtain it is to use ES6 `import * as reducers` syntax, but you can also construct this object manually. See the notes below for some rules every passed reducer must follow.
17
17
18
18
#### Returns
19
19
@@ -29,7 +29,7 @@ Any reducer passed to `combineReducers` must satisfy these rules:
29
29
30
30
* It may never return `undefined`. It is too easy to do this by mistake via an early `return` statement, so `combineReducers` throws if you do that instead of letting the error manifest itself somewhere else.
31
31
32
-
* If the `state` given to it is `undefined`, it must return the initial state for this specific reducer. According to the previous rule, the initial state must not be `undefined` either. It is handy to to specify it with ES6 optional arguments syntax, but you can also explicitly check the first argument for being `undefined`.
32
+
* If the `state` given to it is `undefined`, it must return the initial state for this specific reducer. According to the previous rule, the initial state must not be `undefined` either. It is handy to specify it with ES6 optional arguments syntax, but you can also explicitly check the first argument for being `undefined`.
33
33
34
34
While `combineReducers` attempts to check that your reducers conform to some of these rules, you should remember them, and do your best to follow them.
0 commit comments