Wait for the page to finish loading, including when the load event has already fired.
load
Usage:
import { windowLoaded } from "mazey";windowLoaded() .then(res => { console.log(`Load Success: ${res}`); }) .catch(err => { console.log(`Load Timeout or Fail: ${err.message}`); }); Copy
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 Copy
Load Success: load
Timeout in milliseconds. Defaults to 30,000.
A promise that resolves to "complete" or "load", or rejects on timeout.
"complete"
"load"
Wait for the page to finish loading, including when the
loadevent has already fired.Usage:
Output: