Package-level declarations

Types

Link copied to clipboard

Default constants used by the Respawn library for saving and restoring state.

Properties

Link copied to clipboard

Checks if the default state was successfully restored from process death. Must be called after respawnMutableStateFlow has been initialized for the default key.

Functions

Link copied to clipboard

Checks if the state associated with the given key was successfully restored from process death.

Link copied to clipboard
inline fun SavedStateHandle.onInit(key: String = DEFAULT_KEY, init: () -> Unit): SavedStateHandle

Executes the given init block if the state for key was NOT restored from process death.

Link copied to clipboard
inline fun SavedStateHandle.onRestore(key: String = DEFAULT_KEY, restore: () -> Unit): SavedStateHandle

Executes the given restore block if the state for key WAS restored from process death.

Link copied to clipboard
inline fun <T : @Serializable Any> SavedStateHandle.respawnMutableStateFlow(init: () -> T, key: String = RespawnDefaults.DEFAULT_KEY, configuration: SavedStateConfiguration = SavedStateConfiguration.DEFAULT): MutableStateFlow<T>

Creates a MutableStateFlow that is automatically saved and restored across process death.