rtfeldman / seamless-immutable

Immutable data structures for JavaScript which are backwards-compatible with normal JS Arrays and Objects.
BSD 3-Clause "New" or "Revised" License
5.37k stars 194 forks source link

Deep Merge With Nested Identical Array Returns False #154

Closed alexcurtis closed 7 years ago

alexcurtis commented 7 years ago

Please see: https://github.com/rtfeldman/seamless-immutable/issues/94. I still think this is a valid issue -- I am came across it myself. Could we please look into it?

rtfeldman commented 7 years ago

I still think this is a valid issue

I respectfully disagree. 🙂

From the original:

A .merge with {deep: true} of two identical objects that contain an array is returning a new object.

I expect that changing this behavior would be a serious performance regression. You would have to do comparisons at every single step of the merge, to check whether anything had changed. That is not free, and we should not act as though it were!