dom-loaded
TypeScript icon, indicating that this package has built-in type declarations

3.0.0 • Public • Published

dom-loaded

Check when the DOM has loaded like DOMContentLoaded

Unlike DOMContentLoaded, this also works when included after the DOM was loaded.

Install

$ npm install dom-loaded

Usage

import domLoaded from 'dom-loaded';

await domLoaded;
console.log('The DOM is now loaded.');

API

domLoaded

Type: Promise<void>

The promise resolves when the DOM finishes loading or right away if the DOM has already loaded.

domLoaded.hasLoaded

Type: boolean

Synchronously check if the DOM has already finished loading.

Related

Package Sidebar

Install

npm i dom-loaded

Weekly Downloads

336

Version

3.0.0

License

MIT

Unpacked Size

3.92 kB

Total Files

5

Last publish

Collaborators

  • sindresorhus