Packages

t

com.raquo.airstream.common

SingleParentSignal

trait SingleParentSignal[I, O] extends WritableSignal[O] with InternalTryObserver[I]

Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. SingleParentSignal
  2. InternalTryObserver
  3. InternalObserver
  4. WritableSignal
  5. WritableObservable
  6. Signal
  7. SignalSource
  8. Observable
  9. BaseObservable
  10. Named
  11. Source
  12. AnyRef
  13. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Abstract Value Members

  1. abstract def currentValueFromParent(): Try[O]

    Recalculate the signal's current value.

    Recalculate the signal's current value. Typically this asks the parent signal for its current value, and does the math from there, according to the particular signal's logic (e.g. MapSignal would apply the project function).

    This method is used to calculate the signal's initial value, but also to recalculate, this signal's value, to re-sync it with the parent, when this signal is restarted after being stopped. See https://github.com/raquo/Airstream/issues/43

    Attributes
    protected
    Definition Classes
    Signal
  2. abstract val parent: Observable[I]
    Attributes
    protected[this]
  3. abstract val topoRank: Int

    Note: Use Protected.topoRank(observable) to read another observable's topoRank if needed

    Note: Use Protected.topoRank(observable) to read another observable's topoRank if needed

    Attributes
    protected
    Definition Classes
    BaseObservable

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. val _lastUpdateId: Int
    Attributes
    protected[this]
    Definition Classes
    Signal
  5. val _parentLastUpdateId: Int
    Attributes
    protected[this]
  6. def addExternalObserver(observer: Observer[O], owner: Owner): Subscription

    Subscribe an external observer to this observable

    Subscribe an external observer to this observable

    Attributes
    protected[this]
    Definition Classes
    WritableObservableBaseObservable
  7. def addInternalObserver(observer: InternalObserver[O], shouldCallMaybeWillStart: Boolean): Unit

    Child observable should call this method on its parents when it is started.

    Child observable should call this method on its parents when it is started. This observable calls onStart if this action has given it its first observer (internal or external).

    Attributes
    protected[airstream]
    Definition Classes
    WritableObservableBaseObservable
  8. def addObserver(observer: Observer[O])(implicit owner: Owner): Subscription

    Subscribe an external observer to this observable

    Subscribe an external observer to this observable

    Definition Classes
    WritableObservableBaseObservable
  9. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  10. def changes: EventStream[O]

    A stream of all values in this signal, excluding the initial value.

    A stream of all values in this signal, excluding the initial value.

    When re-starting this stream, it emits the signal's new current value if and only if something has caused the signal's value to be updated or re-evaluated while the changes stream was stopped. This way the changes stream stays in sync with the signal even after restarting.

    Definition Classes
    Signal
  11. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
  12. def compose[B](operator: (Signal[O]) => Signal[B]): Signal[B]

    operator

    Note: Must not throw!

    Definition Classes
    Signal
  13. def composeAll[B](changesOperator: (EventStream[O]) => EventStream[B], initialOperator: (Try[O]) => Try[B]): Signal[B]

    changesOperator

    Note: Must not throw!

    initialOperator

    Note: Must not throw!

    Definition Classes
    Signal
  14. def composeChanges[AA >: O](operator: (EventStream[O]) => EventStream[AA]): Signal[AA]

    operator

    Note: Must not throw!

    Definition Classes
    Signal
  15. def debugWith(debugger: Debugger[O]): Signal[O]

    See also debug methods in com.raquo.airstream.debug.DebuggableObservable

    Definition Classes
    SignalBaseObservable
  16. 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
  17. final def displayName: String
    Definition Classes
    Named
  18. def distinct: Signal[O]

    Distinct events (but keep all errors) by == (equals) comparison

    Distinct events (but keep all errors) by == (equals) comparison

    Definition Classes
    BaseObservable
  19. def distinctBy(key: (O) => Any): Signal[O]

    Distinct events (but keep all errors) by matching key Note: key(event) might be evaluated more than once for each event

    Distinct events (but keep all errors) by matching key Note: key(event) might be evaluated more than once for each event

    Definition Classes
    BaseObservable
  20. def distinctByFn(isSame: (O, O) => Boolean): Signal[O]

    Distinct events (but keep all errors) using a comparison function

    Distinct events (but keep all errors) using a comparison function

    Definition Classes
    BaseObservable
  21. def distinctByRef(implicit ev: <:<[O, AnyRef]): Signal[O]

    Distinct events (but keep all errors) by reference equality (eq)

    Distinct events (but keep all errors) by reference equality (eq)

    Definition Classes
    BaseObservable
  22. def distinctErrors(isSame: (Throwable, Throwable) => Boolean): Signal[O]

    Distinct errors only (but keep all events) using a comparison function

    Distinct errors only (but keep all events) using a comparison function

    Definition Classes
    BaseObservable
  23. def distinctTry(isSame: (Try[O], Try[O]) => Boolean): Signal[O]

    Distinct all values (both events and errors) using a comparison function

    Distinct all values (both events and errors) using a comparison function

    Definition Classes
    SignalBaseObservable
  24. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  25. final def equals(obj: Any): Boolean

    Airstream may internally use Scala library functions which use == or hashCode for equality, for example List.contains.

    Airstream may internally use Scala library functions which use == or hashCode for equality, for example List.contains. Comparing observables by structural equality pretty much never makes sense, yet it's not that hard to run into that, all you need is to create a case class subclass, and the Scala compiler will generate a structural-equality equals and hashCode methods for you behind the scenes.

    To prevent that, we make equals and hashCode methods final, using the default implementation (which is reference equality).

    Definition Classes
    BaseObservable → AnyRef → Any
  26. val externalObservers: ObserverList[Observer[O]]

    Note: Observer can be added more than once to an Observable.

    Note: Observer can be added more than once to an Observable. If so, it will observe each event as many times as it was added.

    Attributes
    protected
    Definition Classes
    WritableObservable
  27. final def fireError(nextError: Throwable, transaction: Transaction): Unit
    Attributes
    protected
    Definition Classes
    WritableSignalWritableObservable
  28. def fireTry(nextValue: Try[O], transaction: Transaction): Unit

    Signal propagates only if its value has changed

    Signal propagates only if its value has changed

    Attributes
    protected
    Definition Classes
    WritableSignalWritableObservable
  29. final def fireValue(nextValue: O, transaction: Transaction): Unit
    Attributes
    protected
    Definition Classes
    WritableSignalWritableObservable
  30. def flatMap[B, Inner[_], Output[+_] <: Observable[_]](compose: (O) => Inner[B])(implicit strategy: FlattenStrategy[[+_]Signal[_], Inner, Output]): Output[B]

    compose

    Note: guarded against exceptions

    Definition Classes
    BaseObservable
    Annotations
    @inline()
  31. def foreach(onNext: (O) => Unit)(implicit owner: Owner): Subscription

    Create an external observer from a function and subscribe it to this observable.

    Create an external observer from a function and subscribe it to this observable.

    Note: since you won't have a reference to the observer, you will need to call Subscription.kill() to unsubscribe

    Definition Classes
    BaseObservable
  32. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  33. def getOrCreatePendingObserverRemovals: JsArray[() => Unit]
    Attributes
    protected
    Definition Classes
    BaseObservable
  34. final def hashCode(): Int

    Force reference equality checks.

    Force reference equality checks. See comment for equals.

    Definition Classes
    BaseObservable → AnyRef → Any
  35. val internalObservers: ObserverList[InternalObserver[O]]

    Note: This is enforced to be a Set outside of the type system #performance

    Note: This is enforced to be a Set outside of the type system #performance

    Attributes
    protected
    Definition Classes
    WritableObservable
  36. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  37. val isSafeToRemoveObserver: Boolean
    Attributes
    protected
    Definition Classes
    BaseObservable
  38. def isStarted: Boolean
    Attributes
    protected
    Definition Classes
    BaseObservable
  39. def lastUpdateId: Int
    Attributes
    protected[airstream]
    Definition Classes
    Signal
  40. def map[B](project: (O) => B): Signal[B]

    project

    Note: guarded against exceptions

    Definition Classes
    SignalBaseObservable
  41. def mapTo[B](value: => B): Signal[B]

    value is passed by name, so it will be evaluated whenever the Observable fires.

    value is passed by name, so it will be evaluated whenever the Observable fires. Use it to sample mutable values (e.g. myInput.ref.value in Laminar).

    See also: mapToStrict

    value

    Note: guarded against exceptions

    Definition Classes
    BaseObservable
  42. def mapToStrict[B](value: B): Signal[B]

    value is evaluated strictly, only once, when this method is called.

    value is evaluated strictly, only once, when this method is called.

    See also: mapTo

    Definition Classes
    BaseObservable
  43. def mapToUnit: Signal[Unit]
    Definition Classes
    BaseObservable
  44. def matchStreamOrSignal[B](ifStream: (EventStream[O]) => B, ifSignal: (Signal[O]) => B): B
    Definition Classes
    BaseObservable
  45. 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
  46. val maybeLastSeenCurrentValue: UndefOr[Try[O]]
    Attributes
    protected
    Definition Classes
    WritableSignal
  47. val maybePendingObserverRemovals: UndefOr[JsArray[() => Unit]]

    Observer removals scheduled to run as soon as this observable's event propagation finishes.

    Observer removals scheduled to run as soon as this observable's event propagation finishes. Only put calls to removeInternalObserverNow and removeExternalObserverNow here, no custom logic.

    Attributes
    protected
    Definition Classes
    BaseObservable
  48. def maybeWillStart(): Unit
    Attributes
    protected
    Definition Classes
    BaseObservable
  49. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  50. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  51. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  52. def now(): O

    Get the signal's current value

    Get the signal's current value

    Attributes
    protected[airstream]
    Definition Classes
    Signal
    Exceptions thrown

    the signal's error if its current value is an error

  53. def numAllObservers: Int

    Total number of internal and external observers

    Total number of internal and external observers

    Attributes
    protected
    Definition Classes
    WritableObservableBaseObservable
  54. def observe(implicit owner: Owner): OwnedSignal[O]

    Add a noop observer to this signal to ensure that it's started.

    Add a noop observer to this signal to ensure that it's started. This lets you access .now and .tryNow on the resulting StrictSignal.

    You can use myStream.toWeakSignal.observe.tryNow() to read the last emitted value from event streams just as well.

    Definition Classes
    Signal
  55. def onAddedExternalObserver(observer: Observer[O]): Unit
    Attributes
    protected
    Definition Classes
    SignalBaseObservable
  56. final def onError(nextError: Throwable, transaction: Transaction): Unit

    Must not throw

    Must not throw

    Attributes
    protected
    Definition Classes
    InternalTryObserverInternalObserver
  57. final def onNext(nextValue: I, transaction: Transaction): Unit

    Must not throw

    Must not throw

    Attributes
    protected
    Definition Classes
    InternalTryObserverInternalObserver
  58. def onStart(): Unit

    Here we need to ensure that Signal's default value has been evaluated at least once.

    Here we need to ensure that Signal's default value has been evaluated at least once. It is important because if a Signal gets started by means of its .changes stream acquiring an observer, nothing else would trigger this evaluation because initialValue is not directly used by the .changes stream. However, when the events start coming in, we will need this initialValue because Signal needs to know when its current value has changed.

    Attributes
    protected[this]
    Definition Classes
    SingleParentSignalSignalBaseObservable
  59. def onStop(): Unit

    This method is fired when this observable stops working (listening for parent events and/or firing its own events), that is, when it loses its last Observer (internal or external).

    This method is fired when this observable stops working (listening for parent events and/or firing its own events), that is, when it loses its last Observer (internal or external).

    onStop can potentially be called multiple times, the second time being after it has started again (see onStart).

    Attributes
    protected[this]
    Definition Classes
    SingleParentSignalBaseObservable
  60. def onTry(nextParentValue: Try[I], transaction: Transaction): Unit

    Must not throw

    Must not throw

    Attributes
    protected
    Definition Classes
    SingleParentSignalInternalObserver
  61. def onWillStart(): Unit

    Note: this is overriden in: - com.raquo.airstream.misc.SignalFromStream because parent can be stream, and it has cacheInitialValue logic

    Note: this is overriden in: - com.raquo.airstream.misc.SignalFromStream because parent can be stream, and it has cacheInitialValue logic

    Attributes
    protected
    Definition Classes
    SingleParentSignalBaseObservable
  62. val parentIsSignal: Boolean
    Attributes
    protected[this]
  63. implicit def protectedAccessEvidence: Protected
    Attributes
    protected
    Definition Classes
    BaseObservable
    Annotations
    @inline()
  64. def recover[B >: O](pf: PartialFunction[Throwable, Option[B]]): Signal[B]

    pf

    Note: guarded against exceptions

    Definition Classes
    SignalBaseObservable
  65. def recoverIgnoreErrors: Signal[O]
    Definition Classes
    BaseObservable
  66. def recoverToTry: Signal[Try[O]]

    Convert this to an observable that emits Failure(err) instead of erroring

    Convert this to an observable that emits Failure(err) instead of erroring

    Definition Classes
    SignalBaseObservable
  67. def removeExternalObserver(observer: Observer[O]): Unit

    Note: do not expose this to end users.

    Note: do not expose this to end users. See https://github.com/raquo/Airstream/issues/10

    Removal still happens synchronously, just after we're done iterating over this observable's observers, to avoid interference with that logic.

    Note: The delay is necessary not just because of interference with actual while(index < observers.length) iteration, but also because on a high level it is too risky to remove observers from arbitrary observables while the propagation is running. This would mean that some graphs would not propagate fully, which would break very basic expectations of end users.

    UPDATE: In 15.0.0 we made the observable removal delay more fine grained – previously we would wait until the whole transaction completed before removing observers, now we only wait until this observable's iteration is done. This helped us fix https://github.com/raquo/Airstream/issues/95

    Note: To completely unsubscribe an Observer from this Observable, you need to remove it as many times as you added it to this Observable.

    Attributes
    protected[airstream]
    Definition Classes
    BaseObservable
  68. def removeExternalObserverNow(observer: Observer[O]): Unit
    Attributes
    protected[airstream]
    Definition Classes
    WritableObservableBaseObservable
  69. def removeInternalObserver(observer: InternalObserver[O]): Unit

    Safely remove internal observer (such that it doesn't interfere with iteration over the list of observers).

    Safely remove internal observer (such that it doesn't interfere with iteration over the list of observers). Removal still happens synchronously, just after we're done iterating over this observable's observers.

    Child observable should call this method on its parents when it is stopped.

    Attributes
    protected[airstream]
    Definition Classes
    BaseObservable
  70. def removeInternalObserverNow(observer: InternalObserver[O]): Unit

    Child observable should call parent.removeInternalObserver(childInternalObserver) when it is stopped.

    Child observable should call parent.removeInternalObserver(childInternalObserver) when it is stopped. This observable calls onStop if this action has removed its last observer (internal or external).

    Attributes
    protected[airstream]
    Definition Classes
    WritableObservableBaseObservable
  71. def scanLeft[B](makeInitial: (O) => B)(fn: (B, O) => B): Signal[B]

    A signal that emits the accumulated value every time that the parent signal emits.

    A signal that emits the accumulated value every time that the parent signal emits.

    makeInitial

    Note: guarded against exceptions

    fn

    Note: guarded against exceptions

    Definition Classes
    Signal
  72. def scanLeftRecover[B](makeInitial: (Try[O]) => Try[B])(fn: (Try[B], Try[O]) => Try[B]): Signal[B]

    A signal that emits the accumulated value every time that the parent signal emits.

    A signal that emits the accumulated value every time that the parent signal emits.

    makeInitial

    currentParentValue => initialValue Note: must not throw

    fn

    (currentValue, nextParentValue) => nextValue

    Definition Classes
    Signal
  73. def setCurrentValue(newValue: Try[O], isInitial: Boolean = false): Unit
    Attributes
    protected
    Definition Classes
    WritableSignal
  74. def setDisplayName(name: String): SingleParentSignal.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
  75. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  76. def throwFailure[B](implicit ev: <:<[O, Try[B]]): Signal[B]

    Unwrap Try to "undo" recoverToTry – Encode Failure(err) as observable errors, and Success(v) as events

    Unwrap Try to "undo" recoverToTry – Encode Failure(err) as observable errors, and Success(v) as events

    Definition Classes
    BaseObservable
  77. def toObservable: Signal[O]
    Definition Classes
    SignalSignalSourceSource
  78. def toSignalIfStream[B >: O](ifStream: (EventStream[O]) => Signal[B]): Signal[B]
    Definition Classes
    BaseObservable
  79. def toStreamIfSignal[B >: O](ifSignal: (Signal[O]) => EventStream[B]): EventStream[B]
    Definition Classes
    BaseObservable
  80. 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
  81. def toWeakSignal: Signal[Option[O]]

    Convert this observable to a signal of Option[A].

    Convert this observable to a signal of Option[A]. If it is a stream, set initial value to None.

    Definition Classes
    BaseObservable
  82. def tryNow(): Try[O]

    Note: Initial value is only evaluated if/when needed (when there are observers)

    Note: Initial value is only evaluated if/when needed (when there are observers)

    Attributes
    protected[airstream]
    Definition Classes
    WritableSignalSignal
  83. def updateCurrentValueFromParent(): Unit

    Note: this is overridden in:

    Note: this is overridden in:

    Attributes
    protected
  84. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  85. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  86. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated
  2. def foldLeft[B](makeInitial: (O) => B)(fn: (B, O) => B): Signal[B]
    Definition Classes
    Signal
    Annotations
    @deprecated
    Deprecated

    (Since version 15.0.0-M1) foldLeft was renamed to scanLeft

  3. def foldLeftRecover[B](makeInitial: (Try[O]) => Try[B])(fn: (Try[B], Try[O]) => Try[B]): Signal[B]
    Definition Classes
    Signal
    Annotations
    @deprecated
    Deprecated

    (Since version 15.0.0-M1) foldLeftRecover was renamed to scanLeftRecover

Inherited from InternalTryObserver[I]

Inherited from InternalObserver[I]

Inherited from WritableSignal[O]

Inherited from WritableObservable[O]

Inherited from Signal[O]

Inherited from SignalSource[O]

Inherited from Observable[O]

Inherited from BaseObservable[[+_]Signal[_], O]

Inherited from Named

Inherited from Source[O]

Inherited from AnyRef

Inherited from Any

Ungrouped