EventSource

interface EventSource<T : Any>

A source of events of type T.

See also

Inheritors

Properties

Link copied to clipboard
abstract val coroutineScope: CoroutineScope

the default CoroutineScope to launch listeners in

Link copied to clipboard
abstract val events: Flow<T>

a Flow of events

Functions

Link copied to clipboard
inline fun <T : Any, E : T> EventSource<T>.on(scope: CoroutineScope = coroutineScope, noinline consumer: suspend E.() -> Unit): Job

Convenience method that will invoke the consumer on every event T created by EventSource.events.

inline fun <T : Event> EventSource<Event>.on(scope: CoroutineScope = coroutineScope, noinline consumer: suspend T.() -> Unit): Job

Listens for a TrackEvent