mazey
    Preparing search index...

    Function windowLoaded

    • Wait for the page to finish loading, including when the load event has already fired.

      Usage:

      import { windowLoaded } from "mazey";

      windowLoaded()
      .then(res => {
      console.log(`Load Success: ${res}`);
      })
      .catch(err => {
      console.log(`Load Timeout or Fail: ${err.message}`);
      });

      Output:

      Load Success: load
      

      Parameters

      • timeout: number = 30000

        Timeout in milliseconds. Defaults to 30,000.

      Returns Promise<string>

      A promise that resolves to "complete" or "load", or rejects on timeout.