-
-
Save ycmjason/f80e3a7960115f1ca7c0f8bca9f020b8 to your computer and use it in GitHub Desktop.
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
const watch = (callback: () => any) => { | |
const watcher = { | |
callback: debounce(() => { | |
dependencies.clear() | |
callback() | |
watcher.dependencies = new Set(dependencies) | |
}, 0), | |
dependencies: new Set<symbol>(), | |
} | |
watcher.callback() | |
watchers.push(watcher) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment