IdleService
Service which configures custom 'on idle' behavior for Angular features like @defer.
API
interface IdleService {
requestOnIdle(callback: (deadline?: IdleDeadline | undefined) => void, options?: IdleRequestOptions | undefined): number;
cancelOnIdle(id: number): void;
}
requestOnIdle
numberSchedule callback to be executed when the current application or browser is considered idle.
@paramcallback
(deadline?: IdleDeadline | undefined) => void
@paramoptions
IdleRequestOptions | undefined
@returns
numberan id which allows the scheduled callback to be cancelled before it executes.
cancelOnIdle
voidCancel a previously scheduled callback using the id associated with it.
@paramid
number
@returns
void
Super-powered by Google ©2010–2025.
Code licensed under an MIT-style License. Documentation licensed under CC BY 4.0.
https://angular.dev/api/core/IdleService