Riksdagsmonitor Intelligence Platform - v0.7.19
    Preparing search index...

    Function initLazyDashboards

    • Register dashboard modules for lazy loading via IntersectionObserver.

      When a container element intersects the viewport (with a 200 px pre-fetch margin), its loader is called, the skeleton class is added, and removed once the promise resolves or rejects.

      If IntersectionObserver is unavailable (old browser), all loaders are invoked immediately as a graceful fallback (containers still checked for DOM presence before loading).

      The created IntersectionObserver is returned so callers can hold a reference (preventing GC) and call disconnect() if needed. undefined is returned when the fallback path is taken.

      Parameters

      • dashboards: LazyDashboard[]

        Array of lazy-loadable dashboard descriptors.

      • options: IntersectionObserverInit = ...

        Optional IntersectionObserver init overrides.

      Returns IntersectionObserver

      The active IntersectionObserver, or undefined in fallback mode.