Package kweb.state

Types

CloseReason
Link copied to clipboard
data class CloseReason(explanation: String, cause: Throwable?)
IndexedItem
Link copied to clipboard
data class IndexedItem<I>(index: Int, total: Int, item: I)
KVal
Link copied to clipboard
open class KVal<T>(value: T)
KVar
Link copied to clipboard
class KVar<T>(initialValue: T) : KVal<T>
ReversibleFunction
Link copied to clipboard
abstract class ReversibleFunction<Input, Output>(label: String)
Defines a reversible function, for use by KVar.map.

Functions

closeOnElementCreatorCleanup
Link copied to clipboard
fun ElementCreator<*>.closeOnElementCreatorCleanup(kv: KVal<*>)
modify
Link copied to clipboard
fun <T : Any> KVar<T>.modify(f: (T) -> T)
notNull
Link copied to clipboard
fun <O : Any> KVar<O?>.notNull(default: O? = null, invertDefault: Boolean = true): KVar<O>
property
Link copied to clipboard
inline fun <O, T> KVar<T>.property(property: KProperty1<T, O>): KVar<O>
render
Link copied to clipboard
fun <T> ElementCreator<*>.render(value: KVal<T>, container: ElementCreator<*>.() -> Element = { span().setAttribute("style", JsonPrimitive("display: contents;")) }, block: ElementCreator<Element>.(T) -> Unit)
renderEach
Link copied to clipboard
fun <ITEM : Any, EL : Element> ElementCreator<EL>.renderEach(orderedViewSet: OrderedViewSet<ITEM>, renderer: ElementCreator<EL>.(KVar<ITEM>) -> Unit)
// @sample ordered_view_set_sample
toVar
Link copied to clipboard
fun <T : Any> ElementCreator<*>.toVar(shoebox: Shoebox<T>, key: String): KVar<T>