EventSource

fun interface EventSource<E>

Interface for event sources.

The event source is used for subscribing to events that are external to the Mobius application. This is primarily meant to be used for environmental events - events that come from external signals, like change of network connectivity or a periodic timer, rather than happening because of an effect being triggered or the UI being interacted with.

Parameters

E

the event class

Inheritors

Functions

Link copied to clipboard
abstract fun subscribe(eventConsumer: Consumer<E>): Disposable

Subscribes the supplied consumer to the events from this event source, until the returned Disposable is disposed. Multiple such subscriptions can be in place concurrently for a given event source, without affecting each other.