Write a Counter with Redux (Front End Development Libraries) freeCodeCamp tutorial

preview_player
Показать описание
Certification: Front End Development Libraries
Course: Redux
Lesson: Write a Counter with Redux
freeCodeCamp tutorial

In this lesson, we learn do a counter activity.

Do you need more help with coding?
════════════════════════════

Let's Connect 💯:
════════════════════════════
Рекомендации по теме
Комментарии
Автор

Hello David, I have a few questions if you don't mind.
1. Is there a particular reason why after the constants we define for the action types, we create the counterReducer ? Cause it seems a bit confusing. I would immediately set up the action creators after we create the constants and only then create the counterReducer.

2. When we default the state to 0, by doing state=0 in the arguments of counterReducer, where does that 0 go ? Cause for example i tried doing state++ instead of state + 1 and it doesn't work, so I assumed that the 0 would be associated to a key somewhere in state like state.value gets to be 0 or something

prizonier
visit shbcf.ru