mirror of
https://github.com/microsoft/frontend-bootcamp.git
synced 2026-01-26 14:56:42 +08:00
902 B
902 B
Step 2.5: Redux: Reducers (Exercise)
Exercise
If you still have the app running from a previous step, stop it with ctrl+c. Start the tests instead by running npm test from the root of the frontend-bootcamp folder.
-
First, take a look at the store interface in
exercise/src/store/index.ts. Note that theStoreinterface has two keys:todosandfilter. We'll concentrate ontodos, which is an object where the keys are string IDs and the values are of aTodoItemtype. -
Open
exercise/src/reducers/pureFunctions.tsand fill in the missing function bodies. -
Open
exercise/src/reducers/index.tsand fill in the missing case statements for the switch onaction.type. -
Open
exercise/src/reducers/pureFunctions.spec.tsand implement tests for the functions you wrote forremove,complete, andclear.