GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Docs
  • Tutorials
  • Playground
  • Reference
  • code
  • PrefetchTrigger
  • Prefetching the dependency

This view

  • Original page
  • New address

GeezerVison is showing next.angular.dev — onIdle • Angular

API

function onIdle(
  options?: { timeout?: number | undefined } | undefined,
): Promise<void>;
@paramoptions{ timeout?: number | undefined; } | undefined
@returnsPromise<void>

Description

A PrefetchTrigger helper function to provide the logic of triggering dependency loading when the browser becomes idle.

Internally delegates to the configured IdleService, whose default implementation uses requestIdleCallback when available and falls back to setTimeout otherwise. The default behavior can be replaced with provideIdleServiceWith.

Usage Notes

injectAsync(import(...), {prefetch: onIdle})

// or with custom idle options:
injectAsync(import(...), {prefetch: () => onIdle({timeout: 100})})
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.