observe

abstract fun <T : Any> observe(key: KeyValueStorage.Key<T>): Flow<T?>

Observe changes to the key's value. The current value is emitted immediately, or null if no value has been stored for the key. If a stored value for the key is removed, null gets emitted.

open fun <T : Any> observe(key: KeyValueStorage.Key<T>, defaultValue: T): Flow<T>

Observe changes to the key's value. The current value is emitted immediately, or the defaultValue if no value has been stored for the key. If a stored value for the key is removed, defaultValue gets emitted.