ResultEffect

Functions summary

inline Unit
@Composable
<T : Any?> ResultEffect(
    resultEventBus: ResultEventBus,
    noinline onResult: suspend (T) -> Unit
)

An Effect to provide a result even between different screens

Cmn
Unit
@Composable
<T : Any?> ResultEffect(
    resultKey: String,
    resultEventBus: ResultEventBus,
    onResult: suspend (T) -> Unit
)

An Effect to provide a result even between different screens

Cmn

Functions

@Composable
inline fun <T : Any?> ResultEffect(
    resultEventBus: ResultEventBus = LocalResultEventBus.current,
    noinline onResult: suspend (T) -> Unit
): Unit

An Effect to provide a result even between different screens

The trailing lambda provides the result from a flow of results.

Parameters
<T : Any?>

the type of the result that should be retrieved from this effect

resultEventBus: ResultEventBus = LocalResultEventBus.current

the ResultEventBus to retrieve the result from. The default value is read from the LocalResultEventBus composition local.

noinline onResult: suspend (T) -> Unit

the callback to invoke when a result is received

@Composable
fun <T : Any?> ResultEffect(
    resultKey: String,
    resultEventBus: ResultEventBus = LocalResultEventBus.current,
    onResult: suspend (T) -> Unit
): Unit

An Effect to provide a result even between different screens

The trailing lambda provides the result from a flow of results.

Parameters
resultKey: String

the key that should be associated with this effect

resultEventBus: ResultEventBus = LocalResultEventBus.current

the ResultEventBus to retrieve the result from. The default value is read from the LocalResultEventBus composition local.

onResult: suspend (T) -> Unit

the callback to invoke when a result is received