Implementing the https://egghead.io/courses/getting-started-with-redux course
Enviroment setup at https://github.com/reactjs/redux/tree/master/examples/counter
- State (Object) is read-only
- Only actions change state
- Actions (Object) must have a
type
attribute - Reducer functions
- (state, action)
- State mutations must be made by pure functions (no side-effects)
- Previous state object must remain unchanged by action and a new one created
- createStore create a store that holds the state tree of the application
- getState returns the current state of the application
- dispatch dispatches an action triggering a state change
- subscribe adds a listener with a callback
- Use spread operators and Object.assign to keep objects immutable
- Use
deepFreeze
to guarantee that objects don't change