LoadingState

sealed class LoadingState<out T>

Generic loading state for async data-fetching operations backed by a kotlinx.coroutines.flow.StateFlow.

Matches the classic iOS LoadingState enum pattern for consistent state management across platforms.

Inheritors

Types

Link copied to clipboard
data class Failed(val error: LoadingError) : LoadingState<Nothing>
Link copied to clipboard
data object Idle : LoadingState<Nothing>
Link copied to clipboard
data class Loaded<T>(val data: T) : LoadingState<T>
Link copied to clipboard
data object Loading : LoadingState<Nothing>

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val value: T?

Functions

Link copied to clipboard
inline fun <T, R> LoadingState<T>.map(transform: (T) -> R): LoadingState<R>

Transforms the LoadingState.Loaded payload, leaving every other state untouched.