DynamicComponentProperty

class DynamicComponentProperty<T>(values: Flow<T>)

Generic container for modeling a property for a component class that could be either consist on a value or on a Flow of a value.

Use it like this:

open class SomeComponent {
val myProp = DynamicComponentProperty("some text")
val myBooleanProp = DynamicComponentProperty(false)
}
// within your UI declaration and static values:
someComponent {
myProp("Some specific content")
myBooleanProp(true)
}
// within your UI declaration and dynamic values:
val contentStore = storeOf("Empty")
val toggle = storeOf(false)
someComponent {
myProp(contentStore.data)
myBooleanProp(toggle.data)
}

Constructors

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

Functions

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

Properties

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