Throughout src/js/. is documentation explaining redux and the purpose of each file.
What are the 3 principles of redux?
- The state of your whole appliction is located within the store
- The only way to change a state is by sending a signal to the store
- The state is immutable and cannot change in place (read-only)
What is the three main redux methods?
- getState: For accessing the current state of the application
- dispatch: for dispatching an action
- subscribe: for listening on state changes
Test your knowledge? (answers are documented throughout the code)
- What is the purpose of the store?
- What is a reducer? What 2 parameters does it take?
- What is an action?
- Why do we use declare the type feild in an action as constant?
- If a reducer gets too big; what can we do?