Open raould opened 7 years ago
Premature optimization suggestion, the idea being to avoid merge() calls if possible. See the Clojure transients stuff I think off the top of my head for similar thoughts on using mutation for efficiency inside an otherwise immutable world.
(1) basic
Immutable.from({foo:1},{bar:2}); // returns {foo:1,bar:2}. Immutable.from({foo:1},{foo:2}); // returns {foo:2}.
(2) more bonus, pesudocode:
Immtuable.from({foo:1,bar:2},(e)=>{e.foo=()=>42}); // returns {foo:42,bar:2}.
Premature optimization suggestion, the idea being to avoid merge() calls if possible. See the Clojure transients stuff I think off the top of my head for similar thoughts on using mutation for efficiency inside an otherwise immutable world.
(1) basic
(2) more bonus, pesudocode: