A Promise wrapper for DOMContentLoaded that prevents event duplication.
$ npm i one-ready --save
Respond to the DOM being ready in different JS modules without binding multiple DOMContentLoaded
handlers.
import ready from 'one-ready'
ready.then(() => console.log('Only one DOMContentLoaded event handler is bound.'))
ready.then(() => console.log('Even if imported and called in other modules.'))
- hsx - JSX, webpack, and static Components without React.
MIT. © 2017 Michael Cavalea