3 ms·
This is what the "immutability-helper" library and immer are used for. Or Immutablejs to go even more fancy. It's not that expensive. You don't need to deep cl
by bayesian_horse 4y ago
This is what the "immutability-helper" library and immer are used for. Or Immutablejs to go even more fancy.
It's not that expensive. You don't need to deep clone an array to change one element, you just create a new array linking to all the old elements, except the one you want to change plus the new version. If you understand "referential equality", this will make a lot more sense.