ApiState

sealed interface ApiState<out T>

A state machine for async API calls.

Inheritors

Types

Link copied to clipboard
data class Error(val issue: Issue) : ApiState<Nothing>

The request failed with an Issue.

Link copied to clipboard
data object Idle : ApiState<Nothing>

Initial state before the request has started.

Link copied to clipboard
data object Loading : ApiState<Nothing>

The request is currently in flight.

Link copied to clipboard
data class Success<T>(val data: T) : ApiState<T>

The request completed successfully.