NullableDynamicComponentProperty

class NullableDynamicComponentProperty<T>(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

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

Functions

equals
Link copied to clipboard
js
open operator fun equals(other: Any?): Boolean
hashCode
Link copied to clipboard
js
open fun hashCode(): Int
invoke
Link copied to clipboard
js
operator fun invoke(newValue: T?)
operator fun invoke(newValues: Flow<T?>)
toString
Link copied to clipboard
js
open fun toString(): String

Properties

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