@document/ready

Tiny function that tells you when the document is ready.

Usage no npm install needed!

<script type="module">
  import documentReady from 'https://cdn.skypack.dev/@document/ready';
</script>

README

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

Made by Varld