Package-level declarations

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

Types

Link copied to clipboard
interface ObservableList<T> : MutableList<T>

Observable list interface.

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

Simple observable list implementation.

Link copied to clipboard
interface ObservableSet<T> : MutableSet<T>

Observable set interface.

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

Simple observable set implementation.

Functions

Link copied to clipboard
fun <S, W> W.bind(observableState: <Error class: unknown class><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> W.bind(observableState: <Error class: unknown class><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> W.bindEach(observableState: <Error class: unknown class><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> W.bindEach(observableState: <Error class: unknown class><S>, sub: (S) -> List<T>, equalizer: (T, T) -> Boolean? = null, factory: <Error class: unknown class>.(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> W.bindSync(observableState: <Error class: unknown class><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> W.bindSync(observableState: <Error class: unknown class><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
fun <T> T.bindTo(state: <Error class: unknown class><<Error class: unknown class>>): T
fun <T> T.bindTo(state: <Error class: unknown class><Double>): T
fun <T> T.bindTo(state: <Error class: unknown class><Double?>): T
fun <T> T.bindTo(state: <Error class: unknown class><Int>): T
fun <T> T.bindTo(state: <Error class: unknown class><Int?>): T
fun <S, T> T.bindTo(state: <Error class: unknown class><S>): T
fun <T> T.bindTo(state: <Error class: unknown class><String>): T

Bidirectional data binding to the MutableState instance.

Link copied to clipboard
fun <S, W> W.insert(observableState: <Error class: unknown class><S>, removeChildren: Boolean = true, runImmediately: Boolean = true, factory: <Error class: unknown class>.(S) -> Unit): <Error class: unknown class>

An extension function which inserts child component and binds it to the observable state.

fun <S, T, W> W.insert(observableState: <Error class: unknown class><S>, sub: (S) -> 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 observable state using the sub state extractor.

Link copied to clipboard
fun <S, W> W.insertNotNull(observableState: <Error class: unknown class><S?>, removeChildren: Boolean = true, runImmediately: Boolean = true, factory: <Error class: unknown class>.(S) -> Unit): <Error class: unknown class>

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> W.insertNotNull(observableState: <Error class: unknown class><S>, sub: (S) -> 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 observable state using the sub state extractor when the state value is not null.

Link copied to clipboard
fun <S, W> W.insertWhen(observableState: <Error class: unknown class><S>, condition: (S) -> Boolean, removeChildren: Boolean = true, runImmediately: Boolean = true, factory: <Error class: unknown class>.(S) -> Unit): <Error class: unknown class>

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

fun <S, T, W> W.insertWhen(observableState: <Error class: unknown class><S>, sub: (S) -> T, condition: (T) -> Boolean, 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 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> <Error class: unknown class><S>.sub(contextWidget: <Error class: unknown class>? = null, extractor: (S) -> T): <Error class: unknown class><T>

Returns a sub-store of the original ObservableState