insert When
fun <S, W> W.insertWhen(observableState: <Error class: unknown class><S>, condition: (S) -> Boolean, removeChildren: Boolean = true, runImmediately: Boolean = true, factory: <Error class: unknown class>.(S) -> Unit): <Error class: unknown class>
An extension function which inserts child component and binds it to the observable state when the given condition is true.
Parameters
S
the state type
W
the container type
observable State
the state
remove Children
remove all children of the child 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.insertWhen(observableState: <Error class: unknown class><S>, sub: (S) -> T, condition: (T) -> Boolean, removeChildren: Boolean = true, runImmediately: Boolean = true, factory: <Error class: unknown class>.(T) -> Unit): <Error class: unknown class>
An extension function which inserts child component and binds it to the observable state using the sub state extractor when the given condition is true.
Parameters
S
the state type
T
the sub state type
W
the container type
observable State
the state
sub
an extractor function for sub state
remove Children
remove all children of the child 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