Skip to content

A Promise wrapper for DOMContentLoaded that prevents event duplication.

Notifications You must be signed in to change notification settings

callmecavs/one-ready

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

one-ready

one-ready on NPM Standard JavaScript Style

A Promise wrapper for DOMContentLoaded that prevents event duplication.

Install

$ npm i one-ready --save

Use

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.'))

See Also

  • hsx - JSX, webpack, and static Components without React.

License

MIT. © 2017 Michael Cavalea

About

A Promise wrapper for DOMContentLoaded that prevents event duplication.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published