raf-ready
v1.0.1
Published
Tiny DOM ready using requestAnimationFrame first, falling back to readyState.
Downloads
16
Maintainers
Readme
raf-ready
Fire a callback when the DOM is ready. Prefers requestAnimationFrame
and falls
back to document.readyState
.
Install
npm install --save raf-ready
Usage
import ready from 'raf-ready';
ready(() => {
// do something with the DOM.
});
API
ready(callback)
Fires callback
using available approach.
callback
Type: function