View Model State
Screen state stored as JSON in the supplied SavedStateHandle. Call APIs on the main thread, using a main-thread scope. Restoration guarantees are those of the handle's owner. Keep payloads small and replace collections instead of mutating them in place.
Inheritors
Types
Link copied to clipboard
class Regular<T : Any>(name: String, serializer: KSerializer<T>, stateHandle: SavedStateHandle, scope: CoroutineScope, json: Json = Json, default: T? = null, workerDispatcher: CoroutineDispatcher = Dispatchers.Default) : ViewModelState<T>
Plain values from one-shot or continuous sources.
Link copied to clipboard
class Result<T : Any>(name: String, serializer: KSerializer<T>, stateHandle: SavedStateHandle, scope: CoroutineScope, json: Json = Json, default: T? = null, workerDispatcher: CoroutineDispatcher = Dispatchers.Default) : ViewModelState<T>
Persists payloads; loading and errors are transient. Restored non-null data starts as Success.
Properties
Functions
Link copied to clipboard
Clears the payload without disconnecting observers.
Link copied to clipboard
Link copied to clipboard