1.1.0 • Published 3 years ago
@document/ready v1.1.0
Document Ready
Tiny function that tells you when the document is ready.
Install
# yarn
yarn add @document/ready
# npm
npm install --save @document/ready
Usage
import ready from '@document/ready';
ready(() => {
console.log('🎉 Whoop whoop. The document is ready');
});
API
ready(cb)
Create a dom ready listener.
cb: () => void
A callback function which will be called when the document is ready.
Returns
Returns a dispose function. If you call it, the listener will be revoked.
License
MIT © Tobias Herber