-
Notifications
You must be signed in to change notification settings - Fork 47k
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
Use SameValue instead of === to check for dispatchAction equivalence #14752
Use SameValue instead of === to check for dispatchAction equivalence #14752
Conversation
This makes sense to me, since we also use |
Immutable data structure libraries have their own equality check (like immutable-js). see -> #14569 (comment) |
@acdlite @Jessidhia This really needs a giant warning saying "DO NOT USE ARRAYS AS STATE!!!". This completely breaks them:
is a complete fail, because |
This allows a Reducer/State that happens to hold a
-0
orNaN
to not bail out of the bail outs / incorrectly bail out. It's the same algorithm that is used to check thedeps
array in Effect/Memo/etc.I'm not sure if this is sufficient test coverage, but it does what I expected (and, more importantly, fails if I undo the changes).