Skip to content

Event Listeners

listen

doc.listen("some-event")

The above is equivalent to document.addEventListener("some-event").

Adds an event listener, for "DOMContentLoaded", its preferable to use onready keyword, and pass a fn to it.

unlisten

doc.unlisten("example")

The above is equivalent to document.removeEventListener("example").

Adds an event listener, for "DOMContentLoaded", its preferable to use onready keyword, and pass a fn to it.