-
Notifications
You must be signed in to change notification settings - Fork 13.9k
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
Fix deep equality logic #4730
Fix deep equality logic #4730
Conversation
Zeroed-in on this while a Deck Scatter Plot chart was prompting for refresh on-load. I'm pretty sure using JSON.stringify as a proxy for deep equality is wrong. Not sure how to handle yarn.lock changes here. The changes on yarn.lock are the result of "only" running `yarn add deep-equal`
Codecov Report
@@ Coverage Diff @@
## master #4730 +/- ##
==========================================
- Coverage 72.22% 72.22% -0.01%
==========================================
Files 204 204
Lines 15323 15325 +2
Branches 1180 1181 +1
==========================================
+ Hits 11067 11068 +1
- Misses 4253 4254 +1
Partials 3 3
Continue to review full report at Codecov.
|
Since the package.json was updated, can you also update the yarn.lock file? |
@timifasubaa it's in there, it's just collapsed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, just a note about the equality comparison.
@@ -95,5 +96,5 @@ export function areArraysShallowEqual(arr1, arr2) { | |||
} | |||
|
|||
export function areObjectsEqual(obj1, obj2) { | |||
return JSON.stringify(obj1) === JSON.stringify(obj2); | |||
return equals(obj1, obj2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will compare leaves using ==
instead of ===
, is that the intended behavior? If not, you can pass opts.strict
as true
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. ==
would have been ok in most cases but ===
is preferable. We may not need this utility function anymore but I'm leaving it to minimize code changes.
* Fix deepequality logic Zeroed-in on this while a Deck Scatter Plot chart was prompting for refresh on-load. I'm pretty sure using JSON.stringify as a proxy for deep equality is wrong. Not sure how to handle yarn.lock changes here. The changes on yarn.lock are the result of "only" running `yarn add deep-equal` * Adressing comments
* Fix deepequality logic Zeroed-in on this while a Deck Scatter Plot chart was prompting for refresh on-load. I'm pretty sure using JSON.stringify as a proxy for deep equality is wrong. Not sure how to handle yarn.lock changes here. The changes on yarn.lock are the result of "only" running `yarn add deep-equal` * Adressing comments
* Fix deepequality logic Zeroed-in on this while a Deck Scatter Plot chart was prompting for refresh on-load. I'm pretty sure using JSON.stringify as a proxy for deep equality is wrong. Not sure how to handle yarn.lock changes here. The changes on yarn.lock are the result of "only" running `yarn add deep-equal` * Adressing comments
Zeroed-in on this while a Deck Scatter Plot chart was prompting for
refresh on-load.
I'm pretty sure using JSON.stringify as a proxy for deep equality is
wrong.
Not sure how to handle yarn.lock changes here. The changes on yarn.lock
are the result of "only" running
yarn add deep-equal