mirror of
https://github.com/microsoft/frontend-bootcamp.git
synced 2026-01-26 14:56:42 +08:00
Step 2.5 - Redux: The Store (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 5 to see results.
-
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 typeTodoItem. -
Open
exercise/src/reducers/index.tsand fill in the missing reducer implementations. -
Open
exercise/src/index.tsxand write somedispatchcalls. -
Take a look what is written in the console (F12 on PC,
cmd-option-Ion Mac). -
Observe the state changes and try doing "time travel"