MCPcopy Create free account
hub / github.com/angular/angular / ɵɵdeferPrefetchOnIdle

Function ɵɵdeferPrefetchOnIdle

packages/core/src/defer/instructions.ts:386–398  ·  view source on GitHub ↗
(timeout?: number)

Source from the content-addressed store, hash-verified

384 * @codeGenApi
385 */
386export function ɵɵdeferPrefetchOnIdle(timeout?: number) {
387 const lView = getLView();
388 const tNode = getCurrentTNode()!;
389
390 if (ngDevMode) {
391 const expression = timeout ? `prefetch on idle(${timeout})` : 'prefetch on idle';
392 trackTriggerForDebugging(lView[TVIEW], tNode, expression);
393 }
394
395 if (!shouldAttachTrigger(TriggerType.Prefetch, lView, tNode)) return;
396
397 scheduleDelayedPrefetching(onIdleWrapper({timeout}));
398}
399
400/**
401 * Sets up logic to handle the `on idle` deferred trigger.

Callers

nothing calls this directly

Calls 6

getLViewFunction · 0.90
getCurrentTNodeFunction · 0.90
trackTriggerForDebuggingFunction · 0.90
shouldAttachTriggerFunction · 0.90
onIdleWrapperFunction · 0.90

Tested by

no test coverage detected