Failure

data class Failure(val throwable: Throwable) : State<Nothing>

Constructors

Link copied to clipboard
constructor(throwable: Throwable)

Properties

Link copied to clipboard

Functions

Link copied to clipboard

Executes the given composable block if the State is State.Failure. The Throwable associated with the failure is passed to the block.

Link copied to clipboard
fun <T> State<T>.onIdle(block: @Composable () -> Unit)

Executes the given composable block if the State is State.Idle.

Link copied to clipboard
fun <T> State<T>.onLoading(block: @Composable () -> Unit)

Executes the given composable block if the State is State.Loading.

Link copied to clipboard
fun <T> State<T>.onSuccess(block: @Composable (T) -> Unit)

Executes the given composable block if the State is State.Success. The block will receive the data from the State.Success as its parameter.