Trait/Object

com.thoughtworks.binding.bindable

BindableSeq

Related Docs: object BindableSeq | package bindable

Permalink

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
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 StringFormat
  6. by Ensuring
  7. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. abstract type Value

    Permalink

Abstract Value Members

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

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

    Permalink

Concrete Value Members

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

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

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

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

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

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

    Permalink
    Definition Classes
    Any
  7. final macro def bind: Value

    Permalink
    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
  8. def bindSeq: BindingSeq[Value]

    Permalink
    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]

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

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

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

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

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

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

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

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

    Permalink
    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

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

    Permalink
    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

    Permalink
    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)

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

Shadowed Implicit Value Members

  1. def self: BindableSeq[From]

    Permalink
    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]

    Permalink
    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. def toBindingSeq: BindingSeq[Value]

    Permalink
    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
  4. val typeClassInstance: BindableSeq[BindableSeq[From]] { type Value = tc.Value }

    Permalink
    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
  5. val typeClassInstance: Bindable[BindableSeq[From]] { type Value = tc.Value }

    Permalink
    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 macro def each: Value

    Permalink
    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
    @deprecated
    Deprecated

    (Since version 7.0.0) Use bind 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 any2stringadd[BindableSeq[From]]

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

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

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

Ungrouped