Skip to content

Commit 20c971a

Browse files
committed
docs
1 parent 31f5ac0 commit 20c971a

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,17 +131,17 @@ expect(actionThree(3)).to.deep.equal({
131131
});
132132
```
133133

134-
### `handleAction(type, reducer | reducerMap, ?defaultState)`
134+
### `handleAction(type, reducer | reducerMap = Identity, ?defaultState)`
135135

136136
```js
137137
import { handleAction } from 'redux-actions';
138138
```
139139

140140
Wraps a reducer so that it only handles Flux Standard Actions of a certain type.
141141

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.
143143

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.
145145

146146
```js
147147
handleAction('FETCH_DATA', {
@@ -150,7 +150,9 @@ handleAction('FETCH_DATA', {
150150
});
151151
```
152152

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.
154156

155157
The optional third parameter specifies a default or initial state, which is used when `undefined` is passed to the reducer.
156158

0 commit comments

Comments
 (0)