UiState

data class UiState<T : Any>(val data: T, val loading: Boolean = false, val error: OneTimeEvent<Throwable?> = OneTimeEvent(null))

Data class representing the state of the UI.

Parameters

T

The type of the data.

Constructors

Link copied to clipboard
constructor(data: T, loading: Boolean = false, error: OneTimeEvent<Throwable?> = OneTimeEvent(null))

Properties

Link copied to clipboard
val data: T

The current data of the UI.

Link copied to clipboard

An event representing an error that may have occurred.

Link copied to clipboard
val loading: Boolean = false

A flag indicating whether the UI is in a loading state.