2.2.2 • Published 4 years ago

promisified-dom-events v2.2.2

Weekly downloads
1
License
ISC
Repository
github
Last release
4 years ago

Promisified DOM Events

This is a small library which creates promises for some single events: DOMContentLoaded and window.onload. It doesn't matter when you use it before or after events. If an event has happend promise will be fullfilled.

Install

npm install -S promisified-dom-events

Use

// import
import {loaded, ready} from 'promisified-dom-events';
ready.then(() => {
  // DOM is ready
});
loaded.then(() => {
  // window is loaded
});

// from a global object
window.promisifiedDomEvents.ready.then(() => {
  // DOM is ready
});
window.promisifiedDomEvents.loaded.then(() => {
  // window is loaded
});
2.2.2

4 years ago

2.2.1

4 years ago

2.2.0

4 years ago

2.1.0

5 years ago

2.0.1

6 years ago

2.0.0

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago