Should shouldComponentUpdate use valueOf to deref so doesn't have to check if it is a cursor?
jeffbski opened this issue · comments
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.
Yes! I hadn't considered the .valueOf()
function.
There's is a PR to simplify shouldComponentUpdate
: #78
And we can simplify it even further.
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.
Found that this wouldn't change anything, and not make the code simpler. Closing this. Thanks for all feedback!