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

Should shouldComponentUpdate use valueOf to deref so doesn't have to check if it is a cursor? #82

Closed
jeffbski opened this issue Mar 2, 2015 · 3 comments

Comments

@jeffbski
Copy link
Contributor

jeffbski commented Mar 2, 2015

In the facebook/immutable-js issues we were asking to get a Cursor.isCursor function which could be used rather than checking for deref existence.

Lee Byron suggested that maybe it would be better to use valueOf to deref for comparisons since if it is already not a cursor it returns itself.

See: immutable-js/immutable-js#300 (comment)

@dashed
Copy link
Contributor

dashed commented Mar 2, 2015

Yes! I hadn't considered the .valueOf() function.

There's is a PR to simplify shouldComponentUpdate : #78

And we can simplify it even further.

@mikaelbr
Copy link
Member

mikaelbr commented Mar 2, 2015

Yeah, haven't thought of this. Good move! However, this might break the choice to use different immutable/cursor libraries with Omniscient. As not doing isCursor and unCursor would imply that a different cursor lib would have to implement .valueOf as well.

@mikaelbr
Copy link
Member

Found that this wouldn't change anything, and not make the code simpler. Closing this. Thanks for all feedback!

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

3 participants