mirror of
https://github.com/microsoft/frontend-bootcamp.git
synced 2026-01-26 14:56:42 +08:00
1.1 KiB
1.1 KiB
Step 2.6 - Redux: Dispatching actions and examining state (Exercise)
Visualize state changes with Chrome extension
If you still have npm test running from the previous step, stop it with ctrl+C. Start the app by running npm start from the root of the frontend-bootcamp folder. Click the "exercise" link under day 2 step 6.
-
Install the Redux DevTools extension
-
Hit F12 (
cmd+option+Ion Mac) and open the inspector panel entitled Redux -
Modify
exercise/src/index.tsxto dispatch actions (you're not limited to adding todos; you can also remove and clear) -
Explore the actions' effects using the extension
Playing with dispatching actions inside tests
Stop the app using ctrl+C and start the tests by running npm test.
-
Open
exercise/src/reducers/reducer.spec.ts -
Follow the instructions to fill out the reducer tests