Introduction
At this stage, readers should master the skills in Redux basic, including
- Store / State > Components > Action > Store / State
- Basic understanding on redux-saga
Training in The advance aims at
- Facilitating the mindset migration
- from traditional OOP UI framework favouring stateful application development
- to data-driven functional programming benefiting stateless rendering but single stateful core control
- Defining the details of pure redux architecture
- Fostering the TDD migration
- Dispatching same input to same functional process should persistently output identical result
- Given all components are composed in functional style, the input is imperative to the whole application
- State inside the store is the exclusive input of redux application, in other words, testing the result of a business logic is just verification of state
- Provided that component behaved as a functional process, the regression test might taken place by injecting mock state and asserting output
- Preparing hot code replacement for Corporate level deliverables
Prerequisite
- Components vs Elements vs Instances
- JSX is just an handy syntax to write complex JSON object
- https://facebook.github.io/react/blog/2015/12/18/react-components-elements-and-instances.html
- Reconciliation
- Use of props.key
- Parent change, child reconstruct, thus local state reset
- Solution: flow-based structure of store
- Type persists, props mutates, instance endures
- https://facebook.github.io/react/docs/reconciliation.html
- Higher-order components