- imperative vs. declarative
- imperative: how you want to achieve
- declarative: what you want to achieve
-
i.e. promises
-
immutable objects
-
reduce state side-effects
-
more scalable
-
variables replaced with:
- pipeline: set of data processing elems connected in a series with chained output > input
- higher-order function: either/and takes function as an argument, returns a function as its result
- Example: navigating to other contact, save current contact
- In componentDidUpdate, check for unsaved changed, and save changes.
- declaring actions to be invoked based on prop and state changes
- technique esp useful for components that manage a lot of state
- Library of components for controller compounds
- SRP: single responsibility principle for deciding what gets to be its own component
##### Stateless components & bubbling props - Code smell: duplicating/synchornizing state between a parent and child component ->
- On imperative vs. declarative programming: https://www.netguru.co/blog/imperative-vs-declarative
- Sift Science: https://engineering.siftscience.com/best-practices-for-building-large-react-applications/
- JP: http://jpnarowski.com/enterprise-react-redux-part-1/
- React Docs, State and Lifecycle: https://facebook.github.io/react/docs/state-and-lifecycle.html