/
githubmirror
/
angular
Обзор
Документация
Войти
/
githubmirror
/
angular
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
packages/zone.js/example/js/counting-zone.js
35 строк
801 B
Joey Perrott
refactor: migrate zone.js to prettier formatting (#55427)
29 апр 2024, 19:52
29 апр 2024, 19:52
f307e95
Код
Авторство
О чём код?
/* * See example/counting.html */ Zone['countingZoneSpec'] = { name: 'counterZone', // setTimeout onScheduleTask: function (delegate, current, target, task) { this.data.count += 1; delegate.scheduleTask(target, task); }, // fires when... // - clearTimeout // - setTimeout finishes onInvokeTask: function (delegate, current, target, task, applyThis, applyArgs) { delegate.invokeTask(target, task, applyThis, applyArgs); this.data.count -= 1; }, onHasTask: function (delegate, current, target, hasTask) { if (this.data.count === 0 && !this.data.flushed) { this.data.flushed = true; target.run(this.onFlush); } }, counter: function () { return this.data.count; }, data: {count: 0, flushed: false}, onFlush: function () {}, };