ComponentState

sealed class ComponentState<out T>

ComponentState represents the state of a user profile loading. It can be in a Loading state or a Loaded state.

Inheritors

Types

Link copied to clipboard
data object Empty : ComponentState<Nothing>

Empty represents the state where the data is empty

Link copied to clipboard
data class Loaded<T>(val loadedValue: T) : ComponentState<T>

Loaded represents the state where the user data has been loaded.

Link copied to clipboard

Loading represents the state where the data is still loading.

Functions

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

Transforms the loaded value of a ComponentState using the provided transform function.