kvision / pl.treksoft.kvision.state

Package pl.treksoft.kvision.state

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

Types

ObservableList

interface ObservableList<T> : MutableList<T>, ObservableState<List<T>>

Observable list interface.

ObservableListWrapper

class ObservableListWrapper<T> : MutableList<T>, ObservableList<T>, ObservableState<List<T>>

Simple observable list implementation.

ObservableState

interface ObservableState<S>

An interface of observable state.

StateBinding

class StateBinding<S : Any, CONT : Container, CONTENT> : Widget

A class which binds the given container to the observable state.

Updateable

class Updateable<S : Any, CONTENT>

A helper class for updateable content.

Functions

observableListOf

fun <T> observableListOf(vararg items: T): ObservableListWrapper<T>

Creates an instance of ObservableList

stateBinding

fun <S : Any, CONT : Container> CONT.stateBinding(observableState: ObservableState<S>, factory: CONT.(S) -> Unit): StateBinding<S, CONT, Unit>

DSL builder extension function.

stateUpdate

fun <S : Any, CONT : Container, CONTENT> CONT.stateUpdate(observableState: ObservableState<S>, factory: CONT.(S) -> CONTENT): Updateable<S, CONTENT>

DSL builder extension function for updateable redux content.