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

    Function renderWithFallback

    • Wrap a synchronous or asynchronous render function with an error boundary.

      • Shows a loading skeleton while an async render is in progress.
      • On success the container is left with whatever the render function produced.
      • On failure the container shows an error card with an optional retry button.
      • Each retry re-runs the full renderFn.

      Parameters

      • container: HTMLElement

        Target DOM element that will receive the rendered output.

      • renderFn: () => void | Promise<void>

        Function (sync or async) that populates container.

      • fallbackMessage: string = 'Data temporarily unavailable'

        Human-readable message shown in the error card.

      • options: RenderWithFallbackOptions = {}

        Optional localised labels for the loading/error states.

      Returns Promise<void>