Binding

com.thoughtworks.binding.Binding$
See theBinding companion trait
object Binding extends Companion

Attributes

Authors:

杨博 (Yang Bo) <[email protected]>

Companion:
trait
Graph
Supertypes
trait Companion
class Object
trait Matchable
class Any
Self type
Binding.type

Members list

Concise view

Binding Expressions

AST nodes of binding expressions

object BindingSeq

The companion of a data binding expression of a sequence

The companion of a data binding expression of a sequence

Attributes

Companion:
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
trait BindingSeq[+A] extends Watchable[A] with BindingSeq2Or3[A]

Data binding expression of a sequence

Data binding expression of a sequence

Attributes

Companion:
object
Graph
Supertypes
trait BindingSeq2Or3[A]
trait BindingSeqOrWithFilter[A]
trait Watchable[A]
class Object
trait Matchable
class Any
Known subtypes
class FlatMap[A, B]
class MapBinding[A, B]
class Constants[A]
class Vars[A]
final case class Constant[+A](value: A) extends Binding[A]

A data binding expression that never changes.

A data binding expression that never changes.

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait Binding[A]
trait Watchable[A]
class Object
trait Matchable
class Any
final class Constants[+A] extends BindingSeq[A]

An data binding expression of sequence that never changes.

An data binding expression of sequence that never changes.

Attributes

Companion:
object
Graph
Supertypes
trait BindingSeq[A]
trait BindingSeq2Or3[A]
trait BindingSeqOrWithFilter[A]
trait Watchable[A]
class Object
trait Matchable
class Any
object Constants

Attributes

Companion:
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
final class FlatMap[A, B](upstream: Binding[A], f: A => Binding[B]) extends Binding[B] with ChangedListener[B]

Attributes

Graph
Supertypes
trait Binding[B]
trait Watchable[B]
class Object
trait Matchable
class Any
final class Map[A, B](upstream: Binding[A], f: A => B) extends Binding[B] with ChangedListener[A]

Attributes

Graph
Supertypes
trait Binding[B]
trait Watchable[B]
class Object
trait Matchable
class Any
abstract class MultiMountPoint[-Element](upstream: BindingSeq[Element])

A mechanism that mounts the result of a data binding expression of a sequence into DOM or other system.

A mechanism that mounts the result of a data binding expression of a sequence into DOM or other system.

Attributes

Graph
Supertypes
trait Binding[Unit]
class Object
trait Matchable
class Any
abstract class SingleMountPoint[-Value](upstream: Binding[Value])

A mechanism that mounts the result of a data binding expression of a single value into DOM or other system.

A mechanism that mounts the result of a data binding expression of a single value into DOM or other system.

Use this class only if you must override mount or unmount. If you only want to override set, you can use Binding[Unit] { onUpstreamChange(upstream.bind) } instead.

Attributes

Graph
Supertypes
trait Binding[Unit]
class Object
trait Matchable
class Any
final case class SingletonBindingSeq[A](upstream: Binding[A]) extends BindingSeq[A]

A BindingSeq that contains only one element

A BindingSeq that contains only one element

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait BindingSeq[A]
trait BindingSeq2Or3[A]
trait BindingSeqOrWithFilter[A]
trait Watchable[A]
class Object
trait Matchable
class Any
final class Var[A](var cache: A) extends Binding[A]

Source variable of data binding expression.

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
object Var

Attributes

Companion:
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Var.type
final class Vars[A] extends BindingSeq[A] with HasCache[A]

Source sequence of data binding expression.

Source sequence of data binding expression.

Attributes

Companion:
object
Graph
Supertypes
trait HasCache[A]
trait BindingSeq[A]
trait BindingSeq2Or3[A]
trait BindingSeqOrWithFilter[A]
trait Watchable[A]
class Object
trait Matchable
class Any
object Vars

Attributes

Companion:
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Vars.type

Type members

Classlikes

final class ChangedEvent[+Value](source: Binding[Value], val newValue: Value) extends EventObject

Attributes

Graph
Supertypes
class EventObject
trait Serializable
class Object
trait Matchable
class Any
trait ChangedListener[-Value]

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class FlatMap[A, B]
class Map[A, B]
final class PatchedEvent[+Element](source: BindingSeq[Element], val from: Int, val that: SeqOpsIterable[Element], val replaced: Int) extends EventObject

Attributes

Graph
Supertypes
class EventObject
trait Serializable
class Object
trait Matchable
class Any
trait PatchedListener[-Element]

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
object Rx

Reactive operators for Observables.

Reactive operators for Observables.

Attributes

See also:
Note:

Rx operators are incomplete. Feel free to create a Pull Request if you need a certain operator.

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Rx.type
sealed trait Watchable[+A]

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait BindingSeq[A]
class FlatMap[A, B]
class MapBinding[A, B]
class Constants[A]
class Vars[A]
trait Binding[A]
class Constant[A]
class FlatMap[A, B]
class Map[A, B]
class Var[A]

Inherited classlikes

object Bind

Attributes

Inherited from:
Companion
Graph
Supertypes
class Object
trait Matchable
class Any

Inherited types

opaque type Bind[+A]

Attributes

Inherited from:
Companion

Value members

Inherited methods

final def Bind[A](using dummyImplicit: DummyImplicit): Binding[A] =:= Bind[A]

Attributes

Inherited from:
Companion
inline def apply[A](inline a: A): Binding[A]

Attributes

Inherited from:
Companion

Givens

Inherited givens

Attributes

Inherited from:
Companion

Extensions

Inherited extensions

extension [A](binding: Binding[A])
transparent inline def bind: A

Returns the current value of this Binding and marks the current @dom method depend on this Binding.

Returns the current value of this Binding and marks the current @dom method depend on this Binding.

Each time the value changes, in the current @dom method, all code after the current bind expression will be re-evaluated if the current @dom method is watching. However, code in current @dom method and before the current bind expression will not be re-evaluated. The above rule is not applied to DOM nodes created by XHTML literal. A bind expression under a DOM node does not affect siblings and parents of that node.

Attributes

Note:

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

Inherited from:
Companion