com.thoughtworks.binding.bindable

BindableSeq

trait BindableSeq[-From] extends Serializable

A dependent type class that witnesses a type that can be converted to a BindingSeq[Value].

Source
package.scala
Example:
  1. The bindSeq can be enabled by the following import statement:

    import com.thoughtworks.binding.bindable._

    Then, a @dom XHTML template can establish data-binding on any parameter as long as a BindableSeq type class for the parameter type is available.

    import org.scalajs.dom.raw._
    
    @dom
    def mySection[A: BindableSeq.Lt[?, Node]](parameter: A) = {
      <section>{parameter.bindSeq}</section>
    }

    Note that the ? syntax requires the Scala plug-in kind-projector, which can be enabled by adding the following setting into your build.sbt:

    addCompilerPlugin("org.spire-math" %% "kind-projector" % "0.9.10")
    

    The mySection method accepts any parameter who is a subtype of Binding[Node] or Binding[BindingSeq[Node]].

    import com.thoughtworks.binding._, Binding._
    @dom def myButton: Binding[HTMLButtonElement] = <button type="button">My Button 0</button>
    @dom def myButtons: Binding[BindingSeq[Node]] = <button type="button">My Button 1</button><button type="button">My Button 2</button>
    Binding {
      mySection(myButton).bind.innerHTML should be("")
      mySection(myButtons).bind.innerHTML should be("")
    }.watch()

    And the mySection method also accepts Node, BindingSeq[Node], List[Node], Array[Node], js.Array[Node], or Binding[js.Array[Node]] parameter.

    import scala.scalajs.js
    @dom def test = {
      mySection(<button type="button">My Button 3</button>).bind.innerHTML should be("")
      mySection(<button type="button">My Button 4</button><button type="button">My Button 5</button>).bind.innerHTML should be(
        ""
      )
      mySection(List(<button type="button">My Button 6</button>, <button type="button">My Button 7</button>)).bind.innerHTML should be("")
      mySection(Array(<button type="button">My Button 8</button>, <button type="button">My Button 9</button>)).bind.innerHTML should be("")
      mySection(js.Array(<button type="button">My Button 10</button>, <button type="button">My Button 11</button>)).bind.innerHTML should be("")
      mySection(Constant(js.Array(<button type="button">My Button 12</button>, <button type="button">My Button 13</button>))).bind.innerHTML should be("")
    }
    
    test.watch()

    mySection should not accept irrelevant parameter types like scala.collection.immutable.Set or scala.Int.

    "mySection(Set.empty)" shouldNot compile
    "mySection(42)" shouldNot compile
Linear Supertypes
Type Hierarchy Learn more about scaladoc diagrams
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. BindableSeq
  2. Serializable
  3. Serializable
  4. Any
Implicitly
  1. by toBindableSeqOps
  2. by toBindableOps
  3. by bindableToBinding
  4. by any2stringadd
  5. by any2stringfmt
  6. by any2ArrowAssoc
  7. by any2Ensuring
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Type Members

  1. abstract type Value

Abstract Value Members

  1. abstract def getClass(): Class[_]

    Definition Classes
    Any
  2. abstract def toBindingSeq(from: From): BindingSeq[Value]

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  2. final def ##(): Int

    Definition Classes
    Any
  3. def +(other: String): String

    Implicit information
    This member is added by an implicit conversion from BindableSeq[From] to StringAdd performed by method any2stringadd in scala.Predef.
    Definition Classes
    StringAdd
  4. def ->[B](y: B): (BindableSeq[From], B)

    Implicit information
    This member is added by an implicit conversion from BindableSeq[From] to ArrowAssoc[BindableSeq[From]] performed by method any2ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. final def bind: Value

    Implicit information
    This member is added by an implicit conversion from BindableSeq[From] to Binding[Value] performed by method bindableToBinding in com.thoughtworks.binding.bindable. This conversion will take place only if an implicit value of type Lt[BindableSeq[From], Value] is in scope.
    Definition Classes
    Binding
    Annotations
    @macroImpl( ... )
  8. def bindSeq: BindingSeq[Value]

    Implicit information
    This member is added by an implicit conversion from BindableSeq[From] to Ops[BindableSeq[From]] { type TypeClassType = com.thoughtworks.binding.bindable.BindableSeq[com.thoughtworks.binding.bindable.BindableSeq[From]]{type Value = tc.Value} } performed by method toBindableSeqOps in com.thoughtworks.binding.bindable.BindableSeq.ToBindableSeqOps. This conversion will take place only if an implicit value of type BindableSeq[BindableSeq[From]] is in scope.
    Definition Classes
    Ops
  9. def ensuring(cond: (BindableSeq[From]) ⇒ Boolean, msg: ⇒ Any): BindableSeq[From]

    Implicit information
    This member is added by an implicit conversion from BindableSeq[From] to Ensuring[BindableSeq[From]] performed by method any2Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  10. def ensuring(cond: (BindableSeq[From]) ⇒ Boolean): BindableSeq[From]

    Implicit information
    This member is added by an implicit conversion from BindableSeq[From] to Ensuring[BindableSeq[From]] performed by method any2Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  11. def ensuring(cond: Boolean, msg: ⇒ Any): BindableSeq[From]

    Implicit information
    This member is added by an implicit conversion from BindableSeq[From] to Ensuring[BindableSeq[From]] performed by method any2Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  12. def ensuring(cond: Boolean): BindableSeq[From]

    Implicit information
    This member is added by an implicit conversion from BindableSeq[From] to Ensuring[BindableSeq[From]] performed by method any2Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  13. def equals(arg0: Any): Boolean

    Definition Classes
    Any
  14. def formatted(fmtstr: String): String

    Implicit information
    This member is added by an implicit conversion from BindableSeq[From] to StringFormat performed by method any2stringfmt in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  15. def hashCode(): Int

    Definition Classes
    Any
  16. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  17. def toBinding: Binding[Bindable.Value]

    Implicit information
    This member is added by an implicit conversion from BindableSeq[From] to Ops[BindableSeq[From]] { type TypeClassType = com.thoughtworks.binding.bindable.Bindable[com.thoughtworks.binding.bindable.BindableSeq[From]]{type Value = tc.Value} } performed by method toBindableOps in com.thoughtworks.binding.bindable.Bindable.ToBindableOps. This conversion will take place only if an implicit value of type Bindable[BindableSeq[From]] is in scope.
    Definition Classes
    Ops
  18. def toString(): String

    Definition Classes
    Any
  19. final def unwatch(): Unit

    Implicit information
    This member is added by an implicit conversion from BindableSeq[From] to Binding[Value] performed by method bindableToBinding in com.thoughtworks.binding.bindable. This conversion will take place only if an implicit value of type Lt[BindableSeq[From], Value] is in scope.
    Definition Classes
    Binding
    Annotations
    @inline()
  20. final def watch(): Unit

    Implicit information
    This member is added by an implicit conversion from BindableSeq[From] to Binding[Value] performed by method bindableToBinding in com.thoughtworks.binding.bindable. This conversion will take place only if an implicit value of type Lt[BindableSeq[From], Value] is in scope.
    Definition Classes
    Binding
    Annotations
    @inline()
  21. def [B](y: B): (BindableSeq[From], B)

    Implicit information
    This member is added by an implicit conversion from BindableSeq[From] to ArrowAssoc[BindableSeq[From]] performed by method any2ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Shadowed Implicit Value Members

  1. def self: BindableSeq[From]

    Implicit information
    This member is added by an implicit conversion from BindableSeq[From] to Ops[BindableSeq[From]] { type TypeClassType = com.thoughtworks.binding.bindable.BindableSeq[com.thoughtworks.binding.bindable.BindableSeq[From]]{type Value = tc.Value} } performed by method toBindableSeqOps in com.thoughtworks.binding.bindable.BindableSeq.ToBindableSeqOps. This conversion will take place only if an implicit value of type BindableSeq[BindableSeq[From]] is in scope.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (bindableSeq: Ops[BindableSeq[From]] { type TypeClassType = com.thoughtworks.binding.bindable.BindableSeq[com.thoughtworks.binding.bindable.BindableSeq[From]]{type Value = tc.Value} }).self
    Definition Classes
    Ops
  2. def self: BindableSeq[From]

    Implicit information
    This member is added by an implicit conversion from BindableSeq[From] to Ops[BindableSeq[From]] { type TypeClassType = com.thoughtworks.binding.bindable.Bindable[com.thoughtworks.binding.bindable.BindableSeq[From]]{type Value = tc.Value} } performed by method toBindableOps in com.thoughtworks.binding.bindable.Bindable.ToBindableOps. This conversion will take place only if an implicit value of type Bindable[BindableSeq[From]] is in scope.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (bindableSeq: Ops[BindableSeq[From]] { type TypeClassType = com.thoughtworks.binding.bindable.Bindable[com.thoughtworks.binding.bindable.BindableSeq[From]]{type Value = tc.Value} }).self
    Definition Classes
    Ops
  3. val self: Any

    Implicit information
    This member is added by an implicit conversion from BindableSeq[From] to StringAdd performed by method any2stringadd in scala.Predef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (bindableSeq: StringAdd).self
    Definition Classes
    StringAdd
  4. val self: Any

    Implicit information
    This member is added by an implicit conversion from BindableSeq[From] to StringFormat performed by method any2stringfmt in scala.Predef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (bindableSeq: StringFormat).self
    Definition Classes
    StringFormat
  5. def toBindingSeq: BindingSeq[Value]

    Implicit information
    This member is added by an implicit conversion from BindableSeq[From] to Ops[BindableSeq[From]] { type TypeClassType = com.thoughtworks.binding.bindable.BindableSeq[com.thoughtworks.binding.bindable.BindableSeq[From]]{type Value = tc.Value} } performed by method toBindableSeqOps in com.thoughtworks.binding.bindable.BindableSeq.ToBindableSeqOps. This conversion will take place only if an implicit value of type BindableSeq[BindableSeq[From]] is in scope.
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (bindableSeq: Ops[BindableSeq[From]] { type TypeClassType = com.thoughtworks.binding.bindable.BindableSeq[com.thoughtworks.binding.bindable.BindableSeq[From]]{type Value = tc.Value} }).toBindingSeq
    Definition Classes
    Ops
  6. val typeClassInstance: BindableSeq[BindableSeq[From]] { type Value = tc.Value }

    Implicit information
    This member is added by an implicit conversion from BindableSeq[From] to Ops[BindableSeq[From]] { type TypeClassType = com.thoughtworks.binding.bindable.BindableSeq[com.thoughtworks.binding.bindable.BindableSeq[From]]{type Value = tc.Value} } performed by method toBindableSeqOps in com.thoughtworks.binding.bindable.BindableSeq.ToBindableSeqOps. This conversion will take place only if an implicit value of type BindableSeq[BindableSeq[From]] is in scope.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (bindableSeq: Ops[BindableSeq[From]] { type TypeClassType = com.thoughtworks.binding.bindable.BindableSeq[com.thoughtworks.binding.bindable.BindableSeq[From]]{type Value = tc.Value} }).typeClassInstance
    Definition Classes
    Ops
  7. val typeClassInstance: Bindable[BindableSeq[From]] { type Value = tc.Value }

    Implicit information
    This member is added by an implicit conversion from BindableSeq[From] to Ops[BindableSeq[From]] { type TypeClassType = com.thoughtworks.binding.bindable.Bindable[com.thoughtworks.binding.bindable.BindableSeq[From]]{type Value = tc.Value} } performed by method toBindableOps in com.thoughtworks.binding.bindable.Bindable.ToBindableOps. This conversion will take place only if an implicit value of type Bindable[BindableSeq[From]] is in scope.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (bindableSeq: Ops[BindableSeq[From]] { type TypeClassType = com.thoughtworks.binding.bindable.Bindable[com.thoughtworks.binding.bindable.BindableSeq[From]]{type Value = tc.Value} }).typeClassInstance
    Definition Classes
    Ops

Deprecated Value Members

  1. final def each: Value

    Implicit information
    This member is added by an implicit conversion from BindableSeq[From] to Binding[Value] performed by method bindableToBinding in com.thoughtworks.binding.bindable. This conversion will take place only if an implicit value of type Lt[BindableSeq[From], Value] is in scope.
    Definition Classes
    Binding
    Annotations
    @macroImpl( ... ) @deprecated
    Deprecated

    (Since version 7.0.0) Use bind instead

  2. def x: BindableSeq[From]

    Implicit information
    This member is added by an implicit conversion from BindableSeq[From] to ArrowAssoc[BindableSeq[From]] performed by method any2ArrowAssoc in scala.Predef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (bindableSeq: ArrowAssoc[BindableSeq[From]]).x
    Definition Classes
    ArrowAssoc
    Annotations
    @deprecated
    Deprecated

    (Since version 2.10.0) Use leftOfArrow instead

  3. def x: BindableSeq[From]

    Implicit information
    This member is added by an implicit conversion from BindableSeq[From] to Ensuring[BindableSeq[From]] performed by method any2Ensuring in scala.Predef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (bindableSeq: Ensuring[BindableSeq[From]]).x
    Definition Classes
    Ensuring
    Annotations
    @deprecated
    Deprecated

    (Since version 2.10.0) Use resultOfEnsuring instead

Inherited from Serializable

Inherited from Serializable

Inherited from Any

Inherited by implicit conversion toBindableSeqOps from BindableSeq[From] to Ops[BindableSeq[From]] { type TypeClassType = com.thoughtworks.binding.bindable.BindableSeq[com.thoughtworks.binding.bindable.BindableSeq[From]]{type Value = tc.Value} }

Inherited by implicit conversion toBindableOps from BindableSeq[From] to Ops[BindableSeq[From]] { type TypeClassType = com.thoughtworks.binding.bindable.Bindable[com.thoughtworks.binding.bindable.BindableSeq[From]]{type Value = tc.Value} }

Inherited by implicit conversion bindableToBinding from BindableSeq[From] to Binding[Value]

Inherited by implicit conversion any2stringadd from BindableSeq[From] to StringAdd

Inherited by implicit conversion any2stringfmt from BindableSeq[From] to StringFormat

Inherited by implicit conversion any2ArrowAssoc from BindableSeq[From] to ArrowAssoc[BindableSeq[From]]

Inherited by implicit conversion any2Ensuring from BindableSeq[From] to Ensuring[BindableSeq[From]]

Ungrouped