KVar
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.
From within Kweb's DSL, you can use the ElementCreator.kvar function to create a KVar without needing to import KVar, and which will also call KVar.close when this part of the DOM is cleaned up.
Functions
Close this KVal, and notify all handlers that it has been closed.
Create another KVal that is a mapping of this KVal. The mapping function will be called whenever this KVal changes, and the new KVal will be updated with the result of the mapping function.
Create another KVar that is a bi-directional mapping of this KVar. ReversibleFunction.invoke will be called whenever this KVar changes, and the new KVar will be updated with the result of this mapping function.
Remove a listener from this KVar. The listener will no longer be called when the value property changes.