Listener

class Listener<X : Event, out T : EventTarget>(events: Flow<X>) : Flow<X>

Encapsulates the Flow of the Event.

Constructors

Link copied to clipboard
fun <X : Event, out T : EventTarget> Listener(listener: Listener<X, T>)
Link copied to clipboard
fun <X : Event> Listener(events: Flow<X>)

Functions

Link copied to clipboard
open suspend override fun collect(collector: FlowCollector<X>)
Link copied to clipboard

Calls Event.composedPath on the Event-flow.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Extensions

Link copied to clipboard
Link copied to clipboard
val Flow<MessageEvent>.blob: Flow<Blob>

gives the MessageEvent.data as Flow of Blob

Link copied to clipboard
val Flow<MessageEvent>.body: Flow<String>

gives the MessageEvent.data as Flow of String

Link copied to clipboard
fun <E : Event> Flow<E>.composedPath(): Flow<Array<EventTarget>>

Calls Event.composedPath on the Event-flow.

Link copied to clipboard
val Flow<MessageEvent>.data: Flow<Any?>

gives the MessageEvent.data as Flow of Any

Link copied to clipboard

Extracts a FileList from the Event.target.

Link copied to clipboard
infix fun <A> Flow<A>.handledBy(handler: Handler<A>)

Connects a Flow to a Handler.

infix fun <A> Flow<A>.handledBy(execute: suspend (A) -> Unit): Job

Connects a Flow to a suspendable execute function.

Link copied to clipboard
fun <E : Event> Flow<E>.preventDefault(): Flow<E>

Calls Event.preventDefault on the Event-flow.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Extracts the HTMLInputElement.checked state from the Event.target.

Link copied to clipboard
fun <E : Event> Flow<E>.stopImmediatePropagation(): Flow<E>
Link copied to clipboard
fun <E : Event> Flow<E>.stopPropagation(): Flow<E>

Calls Event.stopPropagation on the Event-flow.

Link copied to clipboard
val <M : ValidationMessage> Flow<List<M>>.valid: Flow<Boolean>

Checks if a Flow of a List of ValidationMessages is valid.

Link copied to clipboard