bindEach

fun <S, W : SimplePanel> W.bindEach(stateFlow: StateFlow<List<S>>, equalizer: (S, S) -> Boolean? = null, factory: SimplePanel.(S) -> Unit): W(source)

An extension function which binds the container to the given state flow of a list of items.

Parameters

S

the state type

W

the container type

stateFlow

the StateFlow instance

equalizer

optional custom equalizer function

factory

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


fun <S, T, W : SimplePanel> W.bindEach(stateFlow: StateFlow<S>, sub: (S) -> List<T>, equalizer: (T, T) -> Boolean? = null, factory: SimplePanel.(T) -> Unit): W(source)

An extension function which binds the container to the given state flow using the sub flow extractor to get a list of items.

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

equalizer

optional custom equalizer function

factory

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