Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

api question/suggestion for Immutable.from() #222

Open
raould opened this issue Jun 1, 2017 · 0 comments
Open

api question/suggestion for Immutable.from() #222

raould opened this issue Jun 1, 2017 · 0 comments

Comments

@raould
Copy link

raould commented Jun 1, 2017

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}.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant