Skip to content

Commit 21cac4a

Browse files
committed
Merge pull request #5 from ustccjw/master
set a default `throw` function
2 parents bbeaad4 + f557983 commit 21cac4a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/handleAction.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ export default function handleAction(type, reducers) {
1212
const handlerKey = isError(action) ? 'throw' : 'next';
1313

1414
// If function is passed instead of map, use as reducer
15-
if (isFunction(reducers)) return reducers(state, action);
15+
if (isFunction(reducers)) {
16+
reducers.next = reducers;
17+
}
1618

1719
// Otherwise, assume an action map was passed
1820
const reducer = reducers[handlerKey];

0 commit comments

Comments
 (0)