News for hackers. Stuff that matters.
Re:Deep Cloning Objects in JavaScript, the Modern Way by Waterluvian on Thursday December 21, 2023 @07:17PM (#38729110)
Immutable structures are beautiful when I’ve got an editor for geographic data and want a high performance undo/redo stack with basically no effort. It’s also considerably cheaper to identify when groups of polygons have changed by object identity rather than deep equality. Did this property change? Did properties in general change? Did this polygon change? Did this collection of polygons change? All using === equality checks without any manual plumbing. About ten years into doing it this way and I’ve got one regret: starting with ImmutableJS instead of Immer.

There are no comments on this comment yet.