Success

data class Success<T>(val data: T) : State<T>

Constructors

Link copied to clipboard
constructor(data: T)

Properties

Link copied to clipboard
val data: T

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.