insert Not Null
fun <Inputs : Any, Events : Any, State : Any, T, W> W.insertNotNull(viewModel: <Error class: unknown class><Inputs, Events, State>, sub: (State) -> T?, 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 given ballast view model using the sub extractor function when the sub state value is not null.
Parameters
Inputs
the inputs type
Events
the events type
State
the state type
T
the sub state type
W
the container type
view Model
the ballast view model instance
sub
an extractor function
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