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 195 forks source link

Add `.merge`, `.without` etc as static methods #81

Closed dgieselaar closed 8 years ago

dgieselaar commented 8 years ago

Is it possibly a good idea to add .merge, .omit, .without, .asMutable() to seamless-immutable as static methods? This way, in production, no properties or methods have to be added to an object. Also, it reduces the chance of trying to call one of those methods on an object which is not wrapped.

rtfeldman commented 8 years ago

I like this idea, and I wish I'd thought of it back when I first made the library! (A production-specific build was not on the radar back then.)

At this point, though, this would be a monumental breaking change for the sake of a performance improvement it's not clear would make a difference for people using the library today.

This seems unlikely to be the right move in the foreseeable future, so I'm going to close this rather than leave it in limbo. Great thought, though!