Files
frontend-bootcamp/step2-08/exercise
2019-03-01 12:41:44 -08:00
..
2019-02-28 11:37:17 -08:00
2019-02-28 22:18:33 -08:00
2019-03-01 12:41:44 -08:00

Step 2.8: Reduce Boilerplate (Exercise)

Lessons | Exercise | Demo

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 demo as usual. Feel free to copy & paste if you get stuck!!

  1. Open up exercise/src/reducers/index.ts

  2. Rewrite the reducer functions todoReducers and filterReducers with the help of createReducer()

  3. Rewrite the reducer() function with combineReducers()

  4. Open up exercise/src/reducers/pureFunctions.ts

  5. 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