Skip to content

ready

ready(callback): () => void

Defined in: core/dom/events.ts:148

Calls callback when the DOM is ready: at once if it already is, or when DOMContentLoaded fires.

() => void

What to do.

A function that cancels the wait. It does nothing once callback has been called.

() => void

const cancel = ready(() => start());
// later, if it is not needed any more:
cancel();