FallbackValue

Writable saved property with a fallback applied only to reads and observation. Assignments are saved normally; reading a fallback never writes it to the handle. Created by StateValue.Companion.required or StateValue.Companion.default.

Functions

Link copied to clipboard
fun flow(): StateFlow<R>

Stable projection, reflecting defaults consistently with delegated reads.

Link copied to clipboard
open operator override fun getValue(thisRef: Any?, property: KProperty<*>): R

Reads the saved value, applying the fallback without persisting it.

Link copied to clipboard
operator fun provideDelegate(ref: Any?, property: KProperty<*>): FallbackValue<T, R>

Binds the underlying property name before observing an implicit key.

Link copied to clipboard
open operator override fun setValue(thisRef: Any?, property: KProperty<*>, value: R)

Saves the assigned value through the underlying property.