Package-level declarations

Classes supporting the observer pattern, including the implementation of the observable list.

Types

Link copied to clipboard

Observable list interface.

Link copied to clipboard
class ObservableListWrapper<T>(val mutableList: MutableList<T> = mutableListOf()) : MutableList<T> , ObservableList<T> , ObservableState<List<T>>

Simple observable list implementation.

Link copied to clipboard

Observable set interface.

Link copied to clipboard
class ObservableSetWrapper<T>(val mutableSet: MutableSet<T> = mutableSetOf()) : MutableSet<T> , ObservableSet<T> , ObservableState<Set<T>>

Simple observable set implementation.

Functions

Link copied to clipboard
fun <S, W : Component> W.bind(observableState: ObservableState<S>, removeChildren: Boolean = true, runImmediately: Boolean = true, factory: W.(S) -> Unit): W

An extension function which binds the widget to the observable state.

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

An extension function which binds the widget to the observable state using the sub state extractor.

Link copied to clipboard
fun <S, W : SimplePanel> W.bindEach(observableState: ObservableState<List<S>>, equalizer: (S, S) -> Boolean? = null, factory: W.(S) -> Unit): W

An extension function which binds the container to the observable state with a list of items.

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

An extension function which binds the container to the observable state with a list of items using the sub state extractor.

Link copied to clipboard
fun <S, W : Component> W.bindSync(observableState: ObservableState<S>, removeChildren: Boolean = true, runImmediately: Boolean = true, factory: W.(S) -> Unit): W

An extension function which binds the widget to the observable state synchronously. It's less efficient than bind, but fully compatible with KVision 4 state bindings.

fun <S, T, W : Component> W.bindSync(observableState: ObservableState<S>, sub: (S) -> T, removeChildren: Boolean = true, runImmediately: Boolean = true, factory: W.(T) -> Unit): W

An extension function which binds the widget to the observable state synchronously using the sub state extractor. It's less efficient than bind, but fully compatible with KVision 4 state bindings.

Link copied to clipboard

Bidirectional data binding to the MutableState instance.

Link copied to clipboard
fun <S, W : SimplePanel> W.insert(observableState: ObservableState<S>, 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.

fun <S, T, W : SimplePanel> W.insert(observableState: ObservableState<S>, sub: (S) -> T, 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.

Link copied to clipboard
fun <S, W : SimplePanel> W.insertNotNull(observableState: ObservableState<S?>, 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 state value is not null.

fun <S, T, W : SimplePanel> W.insertNotNull(observableState: ObservableState<S>, sub: (S) -> T?, 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 state value is not null.

Link copied to clipboard
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.

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.

Link copied to clipboard
fun <T> observableListOf(vararg items: T): ObservableList<T>

Creates an instance of ObservableList

Link copied to clipboard
fun <T> observableSetOf(vararg items: T): ObservableSet<T>

Creates an instance of ObservableSet

Link copied to clipboard
fun <S, T> ObservableState<S>.sub(contextWidget: Widget? = null, extractor: (S) -> T): ObservableState<T>

Returns a sub-store of the original ObservableState