5 ms·
Not saying you're wrong, but I've never heard this argument... How do you figure that immutability helps solve the cache invalidation problem? Immutability wil
by TickleSteve 11y ago
Not saying you're wrong, but I've never heard this argument...
How do you figure that immutability helps solve the cache invalidation problem?
Immutability will cause cache issues, not help solve them. The answer to the question seems to be simply that immutability allows quick comparison due to references being the same so a deep comparison is not necessary, nothing to do with cache-invalidation
- dmak 11y agoWhat are more common arguments you heard of? I'm just curious.
- joewood1972 11y agoI think what was meant was that immutability solves cache synrhoncization issues. More accurately, state synchronization issues. If you think about the DOM as the projected state of an application, immutable data structures allow you to very simply define a functions that perform the transformation from application state to the GUI data structures (e.g. the DOM). If the state mutates this can cause cascading state changes that make this function much harder to reason about.