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
Wraps a reducer so that it only handles Flux Standard Actions of a certain type.
142
142
143
-
If a single reducer is passed, it is used to handle both normal actions and failed actions. (A failed action is analogous to a rejected promise.) You can use this form if you know a certain type of action will never fail, like the increment example above.
143
+
If a `reducer` function is passed, it is used to handle both normal actions and failed actions. (A failed action is analogous to a rejected promise.) You can use this form if you know a certain type of action will never fail, like the increment example above.
144
144
145
-
Otherwise, you can specify separate reducers for `next()` and `throw()`. This API is inspired by the ES6 generator interface.
145
+
Otherwise, you can specify separate reducers for `next()` and `throw()` using the `reducerMap` form. This API is inspired by the ES6 generator interface.
146
146
147
147
```js
148
148
handleAction('FETCH_DATA', {
@@ -151,7 +151,9 @@ handleAction('FETCH_DATA', {
151
151
}, defaultState);
152
152
```
153
153
154
-
If either `next()` or `throw()` are `undefined` or `null`, then the identity function is used for that reducer.
154
+
If either `next()` or `throw()` are `undefined` or `null`, then the identity function is used for that reducer.
155
+
156
+
If the reducer argument (`reducer | reducerMap`) is `undefined`, then the identity function is used.
155
157
156
158
The third parameter `defaultState` is required, and is used when `undefined` is passed to the reducer.
0 commit comments