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.
Parameters
Section titled “Parameters”callback
Section titled “callback”() => void
What to do.
Returns
Section titled “Returns”A function that cancels the wait. It does nothing once callback has been called.
() => void
Example
Section titled “Example”const cancel = ready(() => start());// later, if it is not needed any more:cancel();