Files
frontend-bootcamp/step2-05/exercise
2019-03-04 19:01:59 -08:00
..
2019-03-02 22:56:59 -08:00
2019-03-04 19:01:59 -08:00

Step 2.5: Redux: Reducers (Exercise)

Lessons | 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 5 to see results.

  1. First, take a look at the store interface in exercise/src/store/index.ts. Note that the Store interface has two keys: todos and filter. We'll concentrate on todos, which is an object where the keys are string IDs and the values are of type TodoItem.

  2. Open exercise/src/reducers/index.ts and fill in the missing case statements for the switch on action.type.

  3. Open exercise/src/index.tsx and write separate dispatch calls.

  4. Take a look what is written in the console (F12 on PC, cmd-option-I on Mac).

  5. Install the Redux DevTools Chrome or Firefox extensions

  6. Observe the state changes and try doing "time travel"