DataState

class DataState<out T>

DataState class to represent the different states of a value.

Parameters

T

The type of the content.

Properties

Link copied to clipboard
val content: T?

The value, can be null if not available.

Link copied to clipboard
val error: Throwable? = null

The error if any, can be null.

Link copied to clipboard

True if the value is loading, false otherwise.

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
inline fun <T> DataState<T>.UiStates(loading: @Composable () -> Unit, failure: @Composable (error: Throwable?) -> Unit, content: @Composable (content: T, loading: Boolean, error: Throwable?) -> Unit)

Composable function to render the different states of a DataState object.