refactor(core): implement missing OnDestroy for schedulers

Implements the missing OnDestroy interface. Also removes an unused generic from a performance logging function.
This commit is contained in:
SkyZeroZx
2025-12-19 11:52:42 -05:00
committed by Kristiyan Kostadinov
parent 66637f1c3f
commit 02e80b4ea2
3 changed files with 5 additions and 3 deletions
+2 -1
View File
@@ -6,6 +6,7 @@
* found in the LICENSE file at https://angular.dev/license
*/
import type {OnDestroy} from '../core';
import {Injector, inject, ɵɵdefineInjectable} from '../di';
import {NgZone} from '../zone';
@@ -39,7 +40,7 @@ const _cancelIdleCallback = () =>
* to avoid calling `requestIdleCallback` for each defer block (e.g. if
* defer blocks are defined inside a for loop).
*/
export class IdleScheduler {
export class IdleScheduler implements OnDestroy {
// Indicates whether current callbacks are being invoked.
executingCallbacks = false;
+2 -1
View File
@@ -6,6 +6,7 @@
* found in the LICENSE file at https://angular.dev/license
*/
import type {OnDestroy} from '../core';
import {Injector, ɵɵdefineInjectable} from '../di';
import {arrayInsert2, arraySplice} from '../util/array_utils';
import {NgZone} from '../zone';
@@ -39,7 +40,7 @@ export function scheduleTimerTrigger(delay: number, callback: VoidFunction, inje
* to avoid calling `setTimeout` for each defer block (e.g. if defer blocks
* are created inside a for loop).
*/
export class TimerScheduler {
export class TimerScheduler implements OnDestroy {
// Indicates whether current callbacks are being invoked.
executingCallbacks = false;
+1 -1
View File
@@ -14,7 +14,7 @@ let enablePerfLogging = false;
* Function that will start measuring against the performance API
* Should be used in pair with stopMeasuring
*/
export function startMeasuring<T>(label: string): void {
export function startMeasuring(label: string): void {
if (!enablePerfLogging) {
return;
}