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
@@ -204,14 +204,16 @@ If the reducer argument (`reducer | reducerMap`) is `undefined`, then the identi
204
204
205
205
The third parameter `defaultState` is required, and is used when `undefined` is passed to the reducer.
206
206
207
-
### `handleActions(reducerMap, defaultState)`
207
+
### `handleActions(reducerMap, defaultState, )`
208
208
209
209
```js
210
210
import { handleActions } from'redux-actions';
211
211
```
212
212
213
213
Creates multiple reducers using `handleAction()` and combines them into a single reducer that handles multiple actions. Accepts a map where the keys are passed as the first parameter to `handleAction()` (the action type), and the values are passed as the second parameter (either a reducer or reducer map). The map must not be empty.
214
214
215
+
If `reducerMap` has a recursive structure, its leaves are used as reducers, and the action type for each leaf is the path to that leaf. If a node's only children are `next()` and `throw()`, the node will be treated as a reducer. If the leaf is `undefined` or `null`, the identity function is used as the reducer. Otherwise, the leaf should be the reducer function. When using this form, you can pass an object with key `namespace` as the last positional argument (the default is `/`).
216
+
215
217
The second parameter `defaultState` is required, and is used when `undefined` is passed to the reducer.
216
218
217
219
(Internally, `handleActions()` works by applying multiple reducers in sequence using [reduce-reducers](https://github.com/acdlite/reduce-reducers).)
0 commit comments