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

Set method will check if value is same? #233

Open
jintoppy opened this issue Aug 23, 2017 · 0 comments
Open

Set method will check if value is same? #233

jintoppy opened this issue Aug 23, 2017 · 0 comments

Comments

@jintoppy
Copy link

This is what it says in Immutable.js docs.

As a performance optimization Immutable.js attempts to return the existing collection when an operation would result in an identical collection, allowing for using === reference equality to determine if something definitely has not changed. This can be extremely useful when used within a memoization function which would prefer to re-run the function if a deeper equality check could potentially be more costly. The === equality check is also used internally by Immutable.is and .equals() as a performance optimization.

That means, even if we set a value, it wont create a new reference, if the new value given is same as the existing value.

Is it the same case with seamless-immutable?

Also, what is the method to do an equality check? Like, equals in ImmutableJS

Thanks in advance.

PS: I am asking a question here. You could ask why I didn't ask in StackOverflow. It is because, I couldn't find these items mentioned anywhere in the docs. I feel, these are important enough to be part of documentation. Thats why adding as a github issue.

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