implement simple insurance system using redux
action creator
-> action
-> dispatch
-> reducer
-> state
- action creator defines and returns action
- dispatch actions
- reducer processes the actions
- update state
- return an action (object)
- action consists of type and payload
- type is string to be distinguished by reducer
- payload is data
- distinguish action type, and process
- return state
- can be combined multiple reducers using
combindeReducers
- store is state which consists of reducers
- managing state by dispatching actions (=> operate reducer)