Content
inline fun <T> UiState<T>.Content(crossinline onSuccess: @Composable (data: T) -> Unit, noinline onLoading: @Composable () -> Unit? = null, noinline onIdle: @Composable () -> Unit? = null, noinline onFailure: @Composable (throwable: Throwable) -> Unit? = null)
Exhaustively renders UI content based on the current UiState.
Example usage:
myState.Content(
onIdle = { Text("Waiting for input...") },
onLoading = { CircularProgressIndicator() },
onFailure = { error -> Text("Error: ${error.message}") },
onSuccess = { data -> Text("Loaded: $data") }
)Content copied to clipboard