Redux helps you write applications that behave consistently, run in different environments (client, server, and native), and are easy to test
Redux Cycle
Action Creator
Action
dispatch
Reducers
State
We will do an example, a model of insurance company.
policy - customer holds a policy, if bad stuff happends to them then we pay them
claim - customer had something bad happen to them, we need to pay them
Customer will bring to our company new Form. There is Form receiver, which will pass the form to correct department Claims History, Policies or Accounting.
Each ‘Form’ is an object, which has Type and Payload.
type - name, claim or policy
payload - contains name of customer and value
We will have 3 types of form
Create Policy
Create Claim
Delete Policy
So when we put this to redux cycle, it will look like this: