insertWhen

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

An extension function which inserts child component and binds it to the given ballast view model when the given condition is true.

Parameters

Inputs

the inputs type

Events

the events type

State

the state type

W

the container type

viewModel

the ballast view model instance

condition

the condition predicate

removeChildren

remove all children of the child 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 : SimplePanel> W.insertWhen(viewModel: <Error class: unknown class><Inputs, Events, State>, sub: (State) -> T, condition: (T) -> Boolean, removeChildren: Boolean = true, runImmediately: Boolean = true, factory: SimplePanel.(T) -> Unit): SimplePanel

An extension function which inserts child component and binds it to the given ballast view model using the sub extractor function when the given condition is true.

Parameters

Inputs

the inputs type

Events

the events type

State

the state type

T

the sub state type

W

the container type

viewModel

the ballast view model instance

sub

an extractor function

condition

the condition predicate

removeChildren

remove all children of the child 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 : SimplePanel> W.insertWhen(stateFlow: <Error class: unknown class><S>, condition: (S) -> Boolean, removeChildren: Boolean = true, runImmediately: Boolean = true, factory: SimplePanel.(S) -> Unit): SimplePanel

An extension function which inserts child component and binds it to the given state flow when the given condition is true.

Parameters

S

the state type

W

the container type

stateFlow

the StateFlow instance

condition

the condition predicate

removeChildren

remove all children of the child 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 : SimplePanel> W.insertWhen(stateFlow: <Error class: unknown class><S>, sub: (S) -> T, condition: (T) -> Boolean, removeChildren: Boolean = true, runImmediately: Boolean = true, factory: SimplePanel.(T) -> Unit): SimplePanel

An extension function which inserts child component and binds it to the given state flow using the sub flow extractor when the given condition is true.

Parameters

S

the state type

T

the sub state type

W

the container type

stateFlow

the StateFlow instance

sub

an extractor function for sub flow

condition

the condition predicate

removeChildren

remove all children of the child 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 : SimplePanel> W.insertWhen(observableState: ObservableState<S>, condition: (S) -> Boolean, removeChildren: Boolean = true, runImmediately: Boolean = true, factory: SimplePanel.(S) -> Unit): SimplePanel

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

observableState

the state

removeChildren

remove all children of the child 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 : SimplePanel> W.insertWhen(observableState: ObservableState<S>, sub: (S) -> T, condition: (T) -> Boolean, removeChildren: Boolean = true, runImmediately: Boolean = true, factory: SimplePanel.(T) -> Unit): SimplePanel

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

observableState

the state

sub

an extractor function for sub state

removeChildren

remove all children of the child 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