Skip to content

Instantly share code, notes, and snippets.

@luchsamapparat
Last active March 1, 2021 11:56
Show Gist options
  • Save luchsamapparat/552d0cd29c159d055ca419d5c8d51692 to your computer and use it in GitHub Desktop.
Save luchsamapparat/552d0cd29c159d055ca419d5c8d51692 to your computer and use it in GitHub Desktop.
import { pull } from 'lodash-es';
declare var Zone;
const updateTaskCount: Function = Zone.prototype._updateTaskCount;
window['debug__tasks'] = [];
Zone.prototype._updateTaskCount = function () {
// tslint:disable-next-line:no-console
console.log(arguments);
if (arguments[1] === -1) {
pull(window['debug__tasks'], arguments[0]);
} else {
window['debug__tasks'].push(arguments[0]);
// if (arguments[0].source === 'setInterval') {
// debugger;
// }
}
updateTaskCount.apply(this, arguments);
};
window.debug__tasks.map(task => task.source);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment