class DerivedVar[A, B] extends Var[B]
DerivedVar has the same Var contract as SourceVar, but instead of maintaining its own state it is essentially a lens on the underlying SourceVar.
This Var is active for as long as its signal has listeners.
Being a StrictSignal, it already starts out with a subscription owned by owner,
but even if owner kills its subscriptions, this Var's signal might have other listeners.
- Alphabetic
- By Inheritance
- DerivedVar
- Var
- Named
- Sink
- SignalSource
- Source
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
- 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
- final def displayName: String
- Definition Classes
- Named
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- 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
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def now(): B
- Definition Classes
- Var
- Annotations
- @inline()
- Exceptions thrown
Exceptionif currentValue is a Failure
- final def set(value: B): Unit
- Definition Classes
- Var
- def setDisplayName(name: String): DerivedVar.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
- final def setError(error: Throwable): Unit
- Definition Classes
- Var
- def setTry(tryValue: Try[B]): Unit
- Definition Classes
- Var
- val signal: StrictSignal[B]
- Definition Classes
- DerivedVar → Var
- def someWriter[V](implicit evidence: <:<[Option[V], B]): Observer[V]
Write values into a Var of Option[V] without manually wrapping in Some()
Write values into a Var of Option[V] without manually wrapping in Some()
- Definition Classes
- Var
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toObservable: Signal[B]
- Definition Classes
- Var → SignalSource → Source
- def toObserver: Observer[B]
- 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
- def tryNow(): Try[B]
- Definition Classes
- Var
- Annotations
- @inline()
- def tryUpdate(mod: (Try[B]) => Try[B]): Unit
- mod
Note: must not throw
- Definition Classes
- Var
- Exceptions thrown
Exceptionifmodthrows
- def tryUpdater[B](mod: (Try[B], B) => Try[B]): Observer[B]
- mod
(currValue, nextInput) => nextValue Note: Must not throw!
- Definition Classes
- Var
- def update(mod: (B) => B): Unit
Do not use on failed Vars.
- def updater[B](mod: (B, B) => B): 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
- Definition Classes
- Var
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- val writer: Observer[B]
- Definition Classes
- Var
- def zoom[B](in: (B) => B)(out: (B) => B)(implicit owner: Owner): Var[B]
- Definition Classes
- Var
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated