Skip to content

Commit

Permalink
fix(core): CHECKOUT-3790 Ensure reducers have the expected signature …
Browse files Browse the repository at this point in the history
…before composing them
  • Loading branch information
davidchin committed Jan 8, 2019
1 parent d66d0f4 commit 8b7f3a9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/compose-reducers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ export default function composeReducers<TState, TAction extends Action = Action>
): Reducer<TState, TAction> {
return (state, action) => {
const newState = flowRight(
reducers.map(reducer => curryRight(reducer)(action))
reducers
.filter(reducer => reducer.length === 2)
.map(reducer => curryRight(reducer)(action))
)(state);

return isEqual(state, newState) ? state : newState;
Expand Down

0 comments on commit 8b7f3a9

Please sign in to comment.