bind
fun <S, W> W.bind(observableState: <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 observable state.
Parameters
S
the state type
W
the widget type
observable State
the state
remove Children
remove all children of the component
run Immediately
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> W.bind(observableState: <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 observable state using the sub state extractor.
Parameters
S
the state type
T
the sub state type
W
the widget type
observable State
the state
sub
an extractor function for sub state
remove Children
remove all children of the component
run Immediately
whether to run factory function immediately with the current state
factory
a function which re-creates the view based on the given state