Created
June 12, 2020 14:28
-
-
Save Akiyamka/c32e5877277cf477f0af73a99b5ab9ee to your computer and use it in GitHub Desktop.
This file contains hidden or 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
function debugLogChanges() { | |
let lastDeps = []; | |
return deps => { | |
deps.forEach((d, i) => { | |
if (!Object.is(lastDeps[i], d)) { | |
console.log(`Change in [${i}]:`, lastDeps[i], '->', d); | |
} | |
}); | |
lastDeps = deps; | |
return deps; | |
}; | |
} | |
const logger = debugLogChanges(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment