Var

com.thoughtworks.binding.Binding$.Var
See theVar companion object
final class Var[A](var cache: A) extends Binding[A]

Source variable of data binding expression.

You can manually change the value:

import com.thoughtworks.binding.Binding.Var
val bindingVar = Var("initial value")
bindingVar.value = "changed value"

Then, any data binding expressions that depend on this Var will be changed automatically.

Attributes

Companion:
object
Graph
Supertypes
trait Binding[A]
trait Watchable[A]
class Object
trait Matchable
class Any

Members list

Concise view

Value members

Concrete methods

override def value: A

Returns the current value of this Binding

Returns the current value of this Binding

Attributes

Note:

This method must not be invoked inside a @dom method body or a Binding { ... } block..

Definition Classes
def value_=(newValue: A): Unit

Changes the current value of this Var, and reevaluates any expressions that depends on this Var.

Changes the current value of this Var, and reevaluates any expressions that depends on this Var.

Attributes

Note:

This method must not be invoked inside a @dom method body or a Binding { ... } block.

Inherited methods

final def flatMap[B](f: A => Binding[B]): Binding[B]

Attributes

Inherited from:
Binding
final def map[B](f: A => B): Binding[B]

Attributes

Inherited from:
Binding
final def unwatch(): Unit

Disable automatic recalculation.

Disable automatic recalculation.

Attributes

Note:

This method is recursive, which means that the dependencies of this Binding will be unwatched as well.

Inherited from:
Binding
final def watch(): Unit

Enable automatic recalculation.

Enable automatic recalculation.

You may invoke this method more than once. Then, when you want to disable automatic recalculation, you must invoke unwatch same times as the number of calls to this method.

Attributes

Note:

This method is recursive, which means that the dependencies of this Binding will be watched as well.

Inherited from:
Binding