Package io.kvision.state

Classes supporting the observer pattern, including the implementation of the observable list.

Functions

bind
Link copied to clipboard
fun <S, W : Widget> W.bind(stateFlow: StateFlow<S>, removeChildren: Boolean = true, factory: W.(S) -> Unit): W
An extension function which binds the widget to the given state flow.
bindEach
Link copied to clipboard
fun <S, W : SimplePanel> W.bindEach(stateFlow: StateFlow<List<S>>, equalizer: (S, S) -> Boolean? = null, factory: SimplePanel.(S) -> Unit): W
An extension function which binds the container to the given state flow of a list of items.
bindTo
Link copied to clipboard
fun <S, T : GenericFormComponent<S>> T.bindTo(mutableStateFlow: MutableStateFlow<S>): T
Bidirectional data binding to the MutableStateFlow instance.
fun <T : GenericFormComponent<Number?>> T.bindTo(mutableStateFlow: MutableStateFlow<Double?>): T
Bidirectional data binding to the MutableStateFlow instance.
fun <T : GenericFormComponent<Number?>> T.bindTo(mutableStateFlow: MutableStateFlow<Double>): T
Bidirectional data binding to the MutableStateFlow instance.
fun <T : GenericFormComponent<Number?>> T.bindTo(mutableStateFlow: MutableStateFlow<Int?>): T
Bidirectional data binding to the MutableStateFlow instance.
fun <T : GenericFormComponent<Number?>> T.bindTo(mutableStateFlow: MutableStateFlow<Int>): T
Bidirectional data binding to the MutableStateFlow instance.
fun <T : GenericFormComponent<String?>> T.bindTo(mutableStateFlow: MutableStateFlow<String>): T
Bidirectional data binding to the MutableStateFlow instance.
fun <T : GenericFormComponent<Date?>> T.bindTo(mutableStateFlow: MutableStateFlow<Date>): T
Bidirectional data binding to the MutableStateFlow instance.
stateFlow
Link copied to clipboard
fun <T, S> ObservableState<S>.stateFlow(sub: (S) -> T): StateFlow<T>
Extension function returning a sub StateFlow for an ObservableState.
subFlow
Link copied to clipboard
fun <T, S> StateFlow<S>.subFlow(sub: (S) -> T): StateFlow<T>
Extension function returning a sub state flow.

Properties

mutableState
Link copied to clipboard
val <S> MutableStateFlow<S>.mutableState: MutableState<S>
Extension property returning a MutableState for a MutableStateFlow.
mutableStateFlow
Link copied to clipboard
val <S> MutableState<S>.mutableStateFlow: MutableStateFlow<S>
Extension property returning a MutableStateFlow for a MutableState.
observableState
Link copied to clipboard
val <S> StateFlow<S>.observableState: ObservableState<S>
Extension property returning an ObservableState for a StateFlow.
observableState
Link copied to clipboard
val <S> Flow<S>.observableState: ObservableState<S?>
Extension property returning an ObservableState<S?
stateFlow
Link copied to clipboard
val <S> ObservableState<S>.stateFlow: StateFlow<S>
Extension property returning a StateFlow for an ObservableState.