MutationState

sealed interface MutationState<out R>

The write-side counterpart to ScreenState: the state of a single mutation (submit/update/delete) a screen renders while it runs. One exhaustive type instead of isSubmitting + submitError flags.

Inheritors

Types

Link copied to clipboard
data class Failed(val error: Throwable, val queuedOffline: Boolean = false) : MutationState<Nothing>

The mutation failed. queuedOffline is true when the write was durably enqueued for later replay (an offline/transient failure) — the UI can show "saved, will sync" rather than a hard error.

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

No mutation in flight.

Link copied to clipboard

The mutation is running.

Link copied to clipboard
data class Success<R>(val result: R) : MutationState<R>

The mutation succeeded, carrying its result.