NullableDynamicComponentProperty

class NullableDynamicComponentProperty<T>(var values: Flow<T?>)

Generic container for modeling a property for a component class that could be either consist on a nullable value or on a Flow of a nullable value. This specific implementation could be useful for properties where the distinction between some states and the "not yet set" state is important.

Use it like this:

open class SomeComponent<T> {
val selectedItem = NullableDynamicComponentProperty<T>(emptyFlow())
}
// within your UI declaration and static values:
val selectedStore = storeOf<String>(null)
someComponent<String> {
selectedItem(selectedStore.data) // no selection at start up!
}

Constructors

Link copied to clipboard
fun <T> NullableDynamicComponentProperty(values: Flow<T?>)

Functions

Link copied to clipboard
operator fun invoke(newValue: T?)
operator fun invoke(newValues: Flow<T?>)

Properties

Link copied to clipboard
var values: Flow<T?>