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

Immutability #13

Open
smizell opened this issue Feb 14, 2015 · 4 comments
Open

Immutability #13

smizell opened this issue Feb 14, 2015 · 4 comments

Comments

@smizell
Copy link
Contributor

smizell commented Feb 14, 2015

I am interested in making the getters and setters be immutable. This means that when you set a value, the old value is not changed, but rather a new object is returned. This requires some fancy work to pass changes up and down the hierarchy and to share the tree, which shouldn't be too hard.

When it's done, it could be a really cool library for use with React, as a component could listen in on only one part of the tree using callbacks.

@smizell smizell changed the title Mutability Immutability Feb 14, 2015
@fosrias
Copy link
Contributor

fosrias commented Feb 15, 2015

What about performance with that overhead of duping the object and then changing?

@smizell
Copy link
Contributor Author

smizell commented Feb 15, 2015

No need to dupe the object I don't think. Since we are not using a data
structure here and simply JS objects for each value, we can share the whole
tree and only change the one value while saving the previous.

On Saturday, February 14, 2015, Mark W. Foster [email protected]
wrote:

What about performance with that overhead of duping the object and then
changing?


Reply to this email directly or view it on GitHub
#13 (comment).

@smizell
Copy link
Contributor Author

smizell commented Feb 17, 2015

I'm going to table this idea for now.

@smizell smizell closed this as completed Feb 17, 2015
@smizell smizell reopened this Feb 18, 2015
@smizell
Copy link
Contributor Author

smizell commented Feb 18, 2015

Well, I'm going to leave this open, as this may be something for future releases. I found this and it may actually be a cool fit for the internals of this if immutability is desired.

https://github.com/facebook/immutable-js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants