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.
141
141
142
-
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.
142
+
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.
143
143
144
-
Otherwise, you can specify separate reducers for `next()` and `throw()`. This API is inspired by the ES6 generator interface.
144
+
Otherwise, you can specify separate reducers for `next()` and `throw()` using the `reducerMap` form. This API is inspired by the ES6 generator interface.
145
145
146
146
```js
147
147
handleAction('FETCH_DATA', {
@@ -150,7 +150,9 @@ handleAction('FETCH_DATA', {
150
150
});
151
151
```
152
152
153
-
If either `next()` or `throw()` are `undefined` or `null`, then the identity function is used for that reducer.
153
+
If either `next()` or `throw()` are `undefined` or `null`, then the identity function is used for that reducer.
154
+
155
+
If the reducer argument (`reducer | reducerMap`) is `undefined`, then the identity function is used.
154
156
155
157
The optional third parameter specifies a default or initial state, which is used when `undefined` is passed to the reducer.
0 commit comments