MCPcopy Index your code
hub / github.com/angular/angular / onIdle

Function onIdle

packages/core/src/di/inject_async.ts:135–145  ·  view source on GitHub ↗
(options?: {timeout?: number})

Source from the content-addressed store, hash-verified

133 * @publicApi 22.0
134 */
135export function onIdle(options?: {timeout?: number}): Promise<void> {
136 if (ngDevMode) {
137 assertInInjectionContext(onIdle);
138 }
139
140 const idleService = inject(IDLE_SERVICE);
141 const {promise, resolve} = promiseWithResolvers<void>();
142 idleService.requestOnIdle(() => resolve(), options);
143
144 return promise;
145}

Callers 1

Calls 5

assertInInjectionContextFunction · 0.90
injectFunction · 0.90
promiseWithResolversFunction · 0.90
requestOnIdleMethod · 0.65
resolveFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…