Manages the loading state of an iframe and communicates with it via postMessage.

Constructors

Properties

Methods

Constructors

Properties

loadState: "loading" | "ready" | "loadError"

Methods

  • Cleans up all registered message event listeners previously added by _listenForMessage. Call this method when the instance is being destroyed or no longer needs to listen to messages.

    Returns void

  • Initializes the LoadManager by listening for a "loadState" message from the iframe. Resolves when the iframe reports that it's in a "ready" state.

    Returns Promise<
        { ready: boolean; state: "timeout"
        | "loading"
        | "ready"
        | "loadError" },
    >

    A promise that resolves with 'ready' and a ready state of when the iframe is ready. If there is no answer after 10 seconds, it will resolve with 'timeout' and a ready state of . If there is a loadError, it resolves to 'loadError' and a ready state of .