subscribe

inline fun <T : Any> EventReceiver.subscribe(priority: Priority = Priority.DEFAULT, ignoreCancelled: Boolean = false, skipRetained: Boolean = false, noinline callback: suspend T.() -> Unit): EventReceiver

Simplified EventReceiver.subscribeTo for Kotlin. Type of event is automatically inferred from callback parameter type.

Return

This instance of EventReceiver for chaining

Parameters

priority

The priority of this listener in the events' collection. (Currently Non Functional)

ignoreCancelled

Whether to ignore events that are cancelled. (Currently Non functional)

skipRetained

Skips event already present in the flow. This is false by default.

callback

The callback function.


A variant of subscribe that uses an instance of EventCallback as callback.

Return

This instance of EventReceiver for chaining

See also

Parameters

priority

The priority of this listener in the events' collection. (Currently Non Functional)

ignoreCancelled

Whether to ignore events that are cancelled. (Currently Non functional)

skipRetained

Skips event already present in the flow. This is false by default

callback

Interface with implemented callback function