Packages

trait Var[A] extends SignalSource[A] with Sink[A] with Named

Var is essentially a Signal that you can write to, so it's a source of state like EventBus is a source of events.

There are two kinds of Vars: SourceVar and DerivedVar. The latter you can obtain by calling zoom(a => b, b => a) on a Var, however, unlike SourceVar, DerivedVar requires an Owner in order to run.

Linear Supertypes
Named, Sink[A], SignalSource[A], Source[A], AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Var
  2. Named
  3. Sink
  4. SignalSource
  5. Source
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Abstract Value Members

  1. abstract val signal: StrictSignal[A]

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
  6. def defaultDisplayName: String

    This is the method that subclasses override to preserve the user's ability to set custom display names.

    This is the method that subclasses override to preserve the user's ability to set custom display names.

    Attributes
    protected
    Definition Classes
    Named
  7. final def displayName: String
    Definition Classes
    Named
  8. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  9. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  10. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  11. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  12. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  13. val maybeDisplayName: UndefOr[String]

    This name should identify the instance (observable or observer) uniquely enough for your purposes.

    This name should identify the instance (observable or observer) uniquely enough for your purposes. You can read / write it to simplify debugging. Airstream uses this in debugLog* methods. In the future, we will expand on this. #TODO[Debug] We don't use this to its full potential yet.

    Attributes
    protected[this]
    Definition Classes
    Named
  14. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  15. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  16. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  17. def now(): A

    Annotations
    @inline()
    Exceptions thrown

    Exception if currentValue is a Failure

  18. final def set(value: A): Unit
  19. def setDisplayName(name: String): Var.this.type

    Set the display name for this instance (observable or observer).

    Set the display name for this instance (observable or observer). - This method modifies the instance and returns this. It does not create a new instance. - New name you set will override the previous name, if any. This might change in the future. For the sake of sanity, don't call this more than once for the same instance. - If display name is set, toString will output it instead of the standard type@hashcode string

    Definition Classes
    Named
  20. final def setError(error: Throwable): Unit
  21. def setTry(tryValue: Try[A]): Unit
  22. def someWriter[V](implicit evidence: <:<[Option[V], A]): Observer[V]

    Write values into a Var of Option[V] without manually wrapping in Some()

  23. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  24. def toObservable: Signal[A]
    Definition Classes
    VarSignalSourceSource
  25. def toObserver: Observer[A]
    Definition Classes
    VarSink
  26. final def toString(): String

    Override defaultDisplayName instead of this, if you need to.

    Override defaultDisplayName instead of this, if you need to.

    Definition Classes
    Named → AnyRef → Any
  27. def tryNow(): Try[A]
    Annotations
    @inline()
  28. def tryUpdate(mod: (Try[A]) => Try[A]): Unit

    mod

    Note: must not throw

    Exceptions thrown

    Exception if mod throws

  29. def tryUpdater[B](mod: (Try[A], B) => Try[A]): Observer[B]

    mod

    (currValue, nextInput) => nextValue Note: Must not throw!

  30. def update(mod: (A) => A): Unit

    Do not use on failed Vars.

    Do not use on failed Vars. Use tryUpdate on those.

    mod

    Note: guarded against exceptions

  31. def updater[B](mod: (A, B) => A): Observer[B]

    An observer much like writer, but can compose input events with the current value of the var, for example:

    An observer much like writer, but can compose input events with the current value of the var, for example:

    val v = Var(List(1, 2, 3)) val appender = v.updater((acc, nextItem) => acc :+ nextItem) appender.onNext(4) // v now contains List(1, 2, 3, 4)

    Do not use on failed Vars. Use tryUpdater on those.

    mod

    (currValue, nextInput) => nextValue

  32. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  33. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  34. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  35. val writer: Observer[A]
  36. def zoom[B](in: (A) => B)(out: (B) => A)(implicit owner: Owner): Var[B]

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

Inherited from Named

Inherited from Sink[A]

Inherited from SignalSource[A]

Inherited from Source[A]

Inherited from AnyRef

Inherited from Any

Ungrouped