Overview
The osagai/events
module has functions for adding event listeners in your custom element DOM tree. Use this module if you need to listen to events.
The osagai/events
module has functions for adding event listeners in your custom element DOM tree. Use this module if you need to listen to events.
on(eventType, element, callback) => Promise
Add an event listener to the element and return a promise when this is done.
A case-sensitive string representing the event typeto listen for
Instance of the element to add the event listener. It could be also a promise that resolve with the element (ex. query
and queryAll
functions from the component function)
A function that runs when the event type occurs. It could also be an object that implements the EventListener interface.
on('click', query('button'), (event) => {
api.makeSomeMagic()
})
Contribute on Github! Edit this section.