Package-level declarations

Types

Link copied to clipboard
data class CloseReason(val explanation: String, val cause: Throwable? = null)
Link copied to clipboard
open class KVal<T>(value: T) : AutoCloseable

A KVal is a read-only observable container for a value of type T. These are typically created by KVal.map or KVar.map, but can also be created directly.

Link copied to clipboard
class KVar<T>(initialValue: T) : KVal<T>

A KVar is an observable container for a value of type T. It must be initialized with initialValue, and this can then be modified by setting the KVar.value property. Listeners may be added using KVar.addListener, and these will be called whenever the value is changed.

Link copied to clipboard
class ObservableList<ITEM : Any>(initialItems: List<ITEM> = emptyList()) : MutableList<ITEM> , AutoCloseable

A list of items that can be observed for changes like add, remove, set, etc. Typically passed to renderEach.

Link copied to clipboard
class RenderFragment(val startId: String, val endId: String)
Link copied to clipboard
class RenderHandle<ITEM : Any>(val renderFragment: RenderFragment, val kvar: KVar<ITEM>)
Link copied to clipboard
Link copied to clipboard
abstract class ReversibleFunction<Input, Output>(val label: String)

Defines a reversible function, for use by KVar.map.

Functions

Link copied to clipboard
fun <A, B> Pair<KVar<A>, KVar<B>>.combine(): KVar<Pair<A, B>>
Link copied to clipboard
fun <O : Any> KVar<O?>.notNull(default: O? = null, invertDefault: Boolean = true): KVar<O>

Bi-directionally map a KVar with nullable type to its non-nullable equivalent.

Link copied to clipboard
operator fun <O : Any> KVal<List<O>>.plus(other: KVal<List<O>>): KVal<List<O>>
Link copied to clipboard
inline fun <O, T> KVar<T>.property(property: KProperty1<T, O>): KVar<O>

Use reflection to create a KVar that bi-directionally maps to a mutable property of an object.

Link copied to clipboard
Link copied to clipboard
fun <ITEM : Any, EL : Element> ElementCreator<EL>.renderEach(observableList: ObservableList<ITEM>, itemRenderer: ElementCreator<Element>.(ITEM) -> Unit)

Similar to render, but renders a list of items, and updates the DOM when the list changes.