Skip to content

Commit

Permalink
Use for-of loop
Browse files Browse the repository at this point in the history
  • Loading branch information
dphilipson committed May 9, 2017
1 parent cd85392 commit 93e3726
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ function getReducerFunction<InS extends OutS, OutS>(
cases: CaseList<InS, OutS>,
) {
return (state = initialState as InS, action: AnyAction) => {
for (let i = 0, length = cases.length; i < length; i++) {
const { actionCreator, handler } = cases[i];
for (const { actionCreator, handler } of cases) {
if (isType(action, actionCreator)) {
return handler(state, action);
}
Expand Down

0 comments on commit 93e3726

Please sign in to comment.