-
-
Notifications
You must be signed in to change notification settings - Fork 389
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: hmr, compare old locals to invalidate if needed
- Loading branch information
1 parent
d18cbfc
commit 6727f11
Showing
2 changed files
with
49 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
function isEqualLocals(a, b) { | ||
if ((!a && b) || (a && !b)) { | ||
return false; | ||
} | ||
|
||
let p; | ||
|
||
for (p in a) { | ||
if (a[p] !== b[p]) { | ||
return false; | ||
} | ||
} | ||
|
||
for (p in b) { | ||
if (!a[p]) { | ||
return false; | ||
} | ||
} | ||
|
||
return true; | ||
} | ||
|
||
module.exports = isEqualLocals; |
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