bind

fun <S, W : Component> W.bind(signal: Signal<S>, removeChildren: Boolean = true, runImmediately: Boolean = true, factory: W.(S) -> Unit): W(source)

An extension function which binds the widget to the given signal.

Parameters

signal

the Signal instance

removeChildren

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

Type Parameters

S

the state type

W

the widget type


fun <S, T, W : Component> W.bind(signal: Signal<S>, sub: (S) -> T, removeChildren: Boolean = true, runImmediately: Boolean = true, factory: W.(T) -> Unit): W(source)

An extension function which binds the widget to the given signal using the substate extractor.

Parameters

signal

the Signal instance

sub

an extractor function for substate

removeChildren

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

Type Parameters

S

the state type

T

the substate type

W

the widget type