subscribe

abstract fun <X : Event> subscribe(eventName: String, capture: Boolean = false, selector: X.() -> Boolean = { true }): Listener<X, T>

Creates an Listener for the given event eventName.

Return

a Listener-object, which is more or less a Flow of the specific Event-type.

Parameters

eventName

the DOM-API name of an event. Can be a custom name.

capture

if true, activates capturing mode, else remains in bubble mode (default)

selector

optional lambda expression to select specific events with option to manipulate it (e.g. preventDefault or stopPropagation).