2 ms·
Not really. You have a state model, once you change it a new immutable slice is created, maintaining the nodes that didn't change. That makes it possible to che
by mlsarecmg 9y ago
Not really. You have a state model, once you change it a new immutable slice is created, maintaining the nodes that didn't change. That makes it possible to check for changes with reference equality (old === new), which is fast. Components simply pick a portion of state they're interested in and render once it changes.
That makes your app transparent, meaning what you see is just a reflection of state. State changes, app reacts, state changes back, app is the same as it was. You can slide through your apps history in dev-tools and see it construct/deconstruct itself, it's also very easy to inspect and see what action led to which result: https://camo.githubusercontent.com/a0d66cf145fe35cbe5fb341494b04f277d5d85dd/687474703a2f2f692e696d6775722e636f6d2f4a34476557304d2e676966 https://camo.githubusercontent.com/a0d66cf145fe35cbe5fb34149...
Redux is a pattern basically, it's pure javascript, no magic, and little behind the scenes stuff.