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.
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<S> for an ObservableState<S>.
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<S> for a MutableStateFlow<S>.
mutableStateFlow
Link copied to clipboard
val <S> MutableState<S>.mutableStateFlow: MutableStateFlow<S>
Extension property returning a MutableStateFlow<S> for a MutableState<S>.
observableState
Link copied to clipboard
val <S> StateFlow<S>.observableState: ObservableState<S>
Extension property returning an ObservableState<S> for a StateFlow<S>.
observableState
Link copied to clipboard
val <S> Flow<S>.observableState: ObservableState<S?>
Extension property returning an ObservableState<S?> for a Flow<S>.
stateFlow
Link copied to clipboard
val <S> ObservableState<S>.stateFlow: StateFlow<S>
Extension property returning a StateFlow<S> for an ObservableState<S>.