Ui State
A generic sealed interface representing the different states of an asynchronous operation or data loading process. Annotated with @Immutable for Jetpack Compose stability and optimal recomposition behavior.
Type Parameters
The type of data held by the Success state.
Inheritors
Properties
Functions
Exhaustively renders UI content based on the current UiState.
Returns the encapsulated throwable if this state is UiState.Failure, or null otherwise.
Applies onSuccess if state is UiState.Success, onFailure if UiState.Failure, onLoading if UiState.Loading, or onIdle if UiState.Idle.
Returns the encapsulated data if this state is UiState.Success, or default otherwise.
Returns the encapsulated data if this state is UiState.Success, or throws the encapsulated Throwable if this state is UiState.Failure, or an IllegalStateException if UiState.Idle or UiState.Loading.
Transforms the UiState.Success data using the given transform function. Non-success states (UiState.Idle, UiState.Loading, UiState.Failure) are passed through unchanged.