What follows is notes from a class. Incomplete thoughts & code that probably will only make sense to me. Given enough time, even that may be a stretch! Reference at your own risk 😂
We went through a few examples of difficult things about state:
- prop drilling is annoying
- you can lose your state if you change pages and the components are destroyed
Every store has management software which is the only thing that can change the state of that store. This management software is called a reducer.
Actions are the code we write which are fed to the reducers to affect state.