bind

fun <S, W : Widget> W.bind(stateFlow: <ERROR CLASS><S>, removeChildren: Boolean = true, factory: W.(S) -> Unit): W

An extension function which binds the widget to the given state flow.

Parameters

S

the state type

W

the widget type

stateFlow

the StateFlow instance

removeChildren

remove all children of the component

factory

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

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

An extension function which binds the widget to the observable state.

Parameters

S

the state type

W

the widget type

observableState

the state

removeChildren

remove all children of the component

factory

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