Package-level declarations
Types
Link copied to clipboard
object CatchScope
A scope for handling error content within the Catch function.
Link copied to clipboard
A host to manage the caught errors of a key.
Link copied to clipboard
Context information to pass to the fallback UI of ErrorBoundary.
Link copied to clipboard
State of the ErrorBoundary.
Link copied to clipboard
State of the Suspense.
Properties
Link copied to clipboard
CompositionLocal for AwaitHost.
Link copied to clipboard
CompositionLocal for CatchThrowHost.
Functions
Link copied to clipboard
inline fun <T> Await(state: DataModel<T>, key: Any? = null, host: AwaitHost = LocalAwaitHost.current, errorPredicate: (DataModel<*>) -> Boolean = { it.reply.isNone }, errorFallback: @Composable CatchScope.(err: Throwable) -> Unit = { Throw(error = it) }, crossinline content: @Composable (data: T) -> Unit)
Await for a DataModel to be fulfilled.
inline fun <T1, T2> Await(state1: DataModel<T1>, state2: DataModel<T2>, key: Any? = null, host: AwaitHost = LocalAwaitHost.current, errorPredicate: (DataModel<*>) -> Boolean = { it.reply.isNone }, errorFallback: @Composable CatchScope.(err: Throwable) -> Unit = { Throw(error = it) }, crossinline content: @Composable (data1: T1, data2: T2) -> Unit)
Await for two DataModel to be fulfilled.
inline fun <T1, T2, T3> Await(state1: DataModel<T1>, state2: DataModel<T2>, state3: DataModel<T3>, key: Any? = null, host: AwaitHost = LocalAwaitHost.current, errorPredicate: (DataModel<*>) -> Boolean = { it.reply.isNone }, errorFallback: @Composable CatchScope.(err: Throwable) -> Unit = { Throw(error = it) }, crossinline content: @Composable (data1: T1, data2: T2, data3: T3) -> Unit)
Await for three DataModel to be fulfilled.
Link copied to clipboard
inline fun Catch(vararg states: DataModel<*>, filter: (DataModel<*>) -> Boolean = { true }, content: @Composable CatchScope.(err: Throwable) -> Unit = { Throw(error = it) })
Catch for any DataModels to be rejected.
Link copied to clipboard
fun ContentVisibility(hidden: Boolean, modifier: Modifier = Modifier, content: @Composable () -> Unit)
A composable that can hide its content without removing it from the layout.
Link copied to clipboard
fun ErrorBoundary(modifier: Modifier = Modifier, fallback: @Composable BoxScope.(ctx: ErrorBoundaryContext) -> Unit? = null, onError: (err: Throwable) -> Unit? = null, onReset: () -> Unit? = null, state: ErrorBoundaryState = remember { ErrorBoundaryState() }, content: @Composable () -> Unit)
Wrap an ErrorBoundary around other Catch composable functions to catch errors and render a fallback UI.
Link copied to clipboard
fun Suspense(fallback: @Composable BoxScope.() -> Unit, modifier: Modifier = Modifier, state: SuspenseState = remember { SuspenseState() }, contentThreshold: Duration = 3.seconds, content: @Composable () -> Unit)
Suspense render a fallback UI while some asynchronous work is being done.