EventChannel
Generic event channel that allows registration of listeners that will be called when an event is published via an appropriate EventPublisher.
Important: This is a Public Preview API. It may be changed or removed at any time.
Functions
Link copied to clipboard
Registers an EventListener which will be notified about published events.
Link copied to clipboard
Unregisters the given EventListener.
Inheritors
Extensions
Link copied to clipboard
Waits till provided event appears in the EventChannel
Link copied to clipboard
fun <T : Event> EventChannel<T>.registerOneShotListener(filter: (T) -> Boolean = { true }, block: (T) -> Unit): Disposable
Content copied to clipboard
Registers EventListener that will be called only one time and only when given condition is met. Optional filter can be used to make the listener triggered only for certain events based on provided criteria. By default, all events are accepted. Once the listener is triggered, it will remove itself from this EventChannel automatically.