bindSync

fun <Inputs : Any, Events : Any, State : Any, W : Component> W.bindSync(viewModel: <Error class: unknown class><Inputs, Events, State>, removeChildren: Boolean = true, runImmediately: Boolean = true, factory: W.(State) -> Unit): W

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

Parameters

Inputs

the inputs type

Events

the events type

State

the state type

W

the widget type

viewModel

the ballast view model instance

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


fun <Inputs : Any, Events : Any, State : Any, T, W : Component> W.bindSync(viewModel: <Error class: unknown class><Inputs, Events, State>, sub: (State) -> T, removeChildren: Boolean = true, runImmediately: Boolean = true, factory: W.(T) -> Unit): W

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

Parameters

Inputs

the inputs type

Events

the events type

State

the state type

T

the sub state type

W

the widget type

viewModel

the ballast view model instance

sub

an extractor function

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


fun <S, W : Component> W.bindSync(stateFlow: <Error class: unknown class><S>, removeChildren: Boolean = true, runImmediately: Boolean = true, factory: W.(S) -> Unit): W

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

Parameters

S

the state type

W

the widget type

stateFlow

the StateFlow instance

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


fun <S, T, W : Component> W.bindSync(stateFlow: <Error class: unknown class><S>, sub: (S) -> T, removeChildren: Boolean = true, runImmediately: Boolean = true, factory: W.(T) -> Unit): W

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

Parameters

S

the state type

T

the sub state type

W

the widget type

stateFlow

the StateFlow instance

sub

an extractor function for sub flow

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


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

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

S

the state type

W

the widget type

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


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

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

S

the state type

T

the sub state type

W

the widget type

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