addEvent
Element type.
Event key.
Event type.
Event handler.
Optional
Event options.
Utility function for adding event listeners.
Attaches event listeners to an element. Allows specifying event types and handlers.
const onClick = addEvent("click", (e) => console.log(e.currentTarget))(MyElement); Copy
const onClick = addEvent("click", (e) => console.log(e.currentTarget))(MyElement);
addEvent