1.2 KiB
Step 2.8: Reduce Boilerplate (Exercise)
If you don't already have the app running, start it by running npm start from the root of the frontend-bootcamp folder. Click the "exercise" link under day 2 step 8 to see results.
Hint! This section is tricky, so the whole solution is inside
demoas usual. Feel free to copy & paste if you get stuck!!
-
Open up
exercise/src/reducers/index.ts -
Rewrite the reducer functions
todoReducersandfilterReducerswith the help ofcreateReducer() -
Rewrite the
reducer()function withcombineReducers() -
Open up
exercise/src/reducers/pureFunctions.ts -
Rewrite all the reducers related to the todos by following the instructions in the code
Further reading
-
immer- Improves ergonomics of working with immutables by introducing the concept of mutating a draft -
redux-starter-kit- Help address common concerns of Redux in boilerplate and complexity