Created
June 6, 2019 22:59
-
-
Save arturovt/83f5d7039887e607d03ac4cad19b636b 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
// Save the original reference to setTimeout | |
const originalSetTimeout = window.setTimeout; | |
// Overwrite the API with a function which wraps callback in zone | |
window.setTimeout = function(callback, delay) { | |
// Invoke the original API but wrap the callback in zone | |
return originalSetTimeout( | |
// Wrap the callback method | |
Zone.current.wrap(callback), | |
delay | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment