Listener

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

Encapsulates the Flow of the Event.

Acts as a marker class in order to keep the type of the element, so we can offer dedicated methods to extract values from some specific events.

See also

Constructors

Link copied to clipboard
constructor(events: Flow<X>)

Properties

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
val Flow<MessageEvent>.data: Flow<Any?>

gives the MessageEvent.data as Flow of Any

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

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

Functions

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

Extracts a FileList from the Event.target.

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
Link copied to clipboard
fun <T> Flow<T>.whenever(condition: Flow<Boolean>): Flow<T?>

This extension method takes a boolean Flow that controls the forwarding of an initial flow: If it is true the current value will be passed further on the result flow, if it is false a null will appear instead.