bindSync

fun <S, W : Component> W.bindSync(observableState: ObservableState<S>, removeChildren: Boolean = true, runImmediately: Boolean = true, factory: W.(S) -> Unit): W(source)

An extension function which binds the widget to the observable state synchronously. It's less efficient than bind, but fully compatible with KVision 4 state bindings.

Parameters

observableState

the state

removeChildren

remove all children of the component

runImmediately

whether to run factory function immediately with the current state

factory

a function which re-creates the view based on the given state

Type Parameters

S

the state type

W

the widget type


fun <S, T, W : Component> W.bindSync(observableState: ObservableState<S>, sub: (S) -> T, removeChildren: Boolean = true, runImmediately: Boolean = true, factory: W.(T) -> Unit): W(source)

An extension function which binds the widget to the observable state synchronously using the sub state extractor. It's less efficient than bind, but fully compatible with KVision 4 state bindings.

Parameters

observableState

the state

sub

an extractor function for sub state

removeChildren

remove all children of the component

runImmediately

whether to run factory function immediately with the current state

factory

a function which re-creates the view based on the given state

Type Parameters

S

the state type

T

the sub state type

W

the widget type