Skip to content

Commit

Permalink
adjust reducer
Browse files Browse the repository at this point in the history
  • Loading branch information
flashdesignory committed Mar 14, 2023
1 parent 296a826 commit e42ef11
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const todoReducer = (state, action) => {
return state.map((todo) => (todo.completed !== action.payload.completed ? { ...todo, completed: action.payload.completed } : todo));
case "REMOVE_COMPLETED_ITEMS":
return state.filter((todo) => !todo.completed);
default:
return state.slice();
}
};

throw Error(`Unknown action: ${action.type}`);
};

0 comments on commit e42ef11

Please sign in to comment.