ResultEventBus

An EventBus for passing results between multiple sets of screens.

It provides solutions for both event and state based results.

For Event results, use a ResultEffect to receive all results.

For State results, use conflateAsState to get only the latest result for a particular key.

These results are not saved across configuration changes or process death.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
inline fun <T> conflateAsState(defaultValue: T): State<T>
fun <T> conflateAsState(resultKey: String, defaultValue: T): State<T>

Provides a single State from the eventBus for the given class type.

Link copied to clipboard
inline fun <T> removeResult()

Removes all results associated with the given type from the store and stops the bus from providing any additional events.

fun removeResult(resultKey: String)

Removes all results associated with the given key from the store and stops the bus from providing any additional events.

Link copied to clipboard
inline fun <T> sendResult(result: T)
fun <T> sendResult(resultKey: String, result: T)

Sends a result into the channel associated with the given resultKey.