You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
No more left over CSS styles and JS methods (are they being used still?)
JSX is great, no more JS/HTML separation
Smart/Dumb components technique allows us to keep state out of components, they should only use what is given to them (one-way data flow)
Redux
Flux technique is in trial as well
Redux is the most popular re-invisioning of flux
Principles
One state store (broken into tree branches for different areas of your application)
Components trigger actions and do not hold or modify state
Pure reducer functions produce a new state from a given state and action
Immutability allows us to quickly check for state changes
Reducers Pseudo Code
// Ordered List of Actions (Action Timeline)varactions=[]// Immutable statevarstate={}// Dispatch Actionfunctiondispatch(action){// Reducers return a new state after handling an actionreturnreducers.reduce((state,reducer)=>reducer(state,action),state)}
Hot reloading
Keeps state (through proxies)
No page refresh
Fast development (with wallaby, even better)
Redux
No mutation!
Mutation has unpredictable side effects all over the place which are hard to trace the source of
Developer tools
It's all about the tools... stop making the same mistakes (DRY)
ESLint (for static analysis)
Hot reloading (keeping state and no refresh)
Debug monitor (see action/state changes, and helpful error messages)