Skip to content

Commit 1dc2449

Browse files
yangmillstheorytimche
authored andcommitted
simplify return logic; remove typeof check (#106)
http://stackoverflow.com/a/4725697/2419669
1 parent d47a785 commit 1dc2449

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/handleActions.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,5 @@ export default function handleActions(handlers, defaultState) {
66
const reducers = ownKeys(handlers).map(type => handleAction(type, handlers[type]));
77
const reducer = reduceReducers(...reducers);
88

9-
return typeof defaultState !== 'undefined'
10-
? (state = defaultState, action) => reducer(state, action)
11-
: reducer;
9+
return (state = defaultState, action) => reducer(state, action);
1210
}

0 commit comments

Comments
 (0)