From a0bdfe2dd072d7b24d291cd782b202c16f075f89 Mon Sep 17 00:00:00 2001 From: Meet Zaveri Date: Mon, 8 Jan 2018 16:25:55 +0530 Subject: [PATCH 1/3] Update redux.md --- redux.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/redux.md b/redux.md index 22b0f8e72..9c17ea3f5 100644 --- a/redux.md +++ b/redux.md @@ -26,6 +26,13 @@ function counter (state = { value: 0 }, action) { } } ``` +### Combine Reducers + +```js +// Combine Reducers into one whole Reducer with combineReducers function +const counterApp = combineReducers({counter,otherReducer,anotherReducer}); +// You can list down reducers here and thanks to ES6 Object literal, we have to only pass key(if key and value are same). +``` ```js let store = createStore(counter) From 2a0855a4946e721a6ab9b92bf16cca80cf30f279 Mon Sep 17 00:00:00 2001 From: "Rico Sta. Cruz" Date: Wed, 17 Jan 2018 17:02:09 +0800 Subject: [PATCH 2/3] Update redux.md --- redux.md | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/redux.md b/redux.md index 9c17ea3f5..aea46aad3 100644 --- a/redux.md +++ b/redux.md @@ -26,13 +26,6 @@ function counter (state = { value: 0 }, action) { } } ``` -### Combine Reducers - -```js -// Combine Reducers into one whole Reducer with combineReducers function -const counterApp = combineReducers({counter,otherReducer,anotherReducer}); -// You can list down reducers here and thanks to ES6 Object literal, we have to only pass key(if key and value are same). -``` ```js let store = createStore(counter) @@ -144,6 +137,16 @@ export default connect( Same as above, but shorter. +### Combining reducers + +```js +const reducer = combineReducers({ + counter, user, store +}) +``` + +Combines multiple reducers into one reducer function. See: [combineReducers](https://redux.js.org/docs/api/combineReducers.html) _(redux.js.org)_ + ## Middleware ### Signature From 0567ba852e2cce28d9de1ceb73c776c2761d29e0 Mon Sep 17 00:00:00 2001 From: "Rico Sta. Cruz" Date: Wed, 17 Jan 2018 17:02:23 +0800 Subject: [PATCH 3/3] Update redux.md --- redux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redux.md b/redux.md index aea46aad3..ad3943d8e 100644 --- a/redux.md +++ b/redux.md @@ -2,7 +2,7 @@ title: Redux category: React layout: 2017/sheet -updated: 2017-08-30 +updated: 2018-01-17 weight: -3 ---