forked from carbon-app/carbon
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't use custom history API (carbon-app#485)
* Add shallowEquals check for onUpdate * Using Next.js Router instead of custom history API Fixes vercel/next.js#4994 * Remove urlObject code
- Loading branch information
1 parent
d41f05d
commit 2e945fc
Showing
4 changed files
with
43 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
export default function shallowEquals (a, b) { | ||
for (const i in a) { | ||
// NaN === NaN is false in Javascript | ||
if(isNaN(b[i]) && isNaN(a[i])) { | ||
continue | ||
} | ||
if (b[i] !== a[i]) { | ||
console.log('DID NOT MATCH', i, a[i], b[i]) | ||
return false | ||
} | ||
} | ||
|
||
for (const i in b) { | ||
// NaN === NaN is false in Javascript | ||
if(isNaN(b[i]) && isNaN(a[i])) { | ||
continue | ||
} | ||
|
||
if (b[i] !== a[i]) { | ||
return false | ||
} | ||
} | ||
|
||
return true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters