trait EventStream[+A] extends Observable[A] with BaseObservable[EventStream, A] with EventSource[A]

Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. EventStream
  2. EventSource
  3. Observable
  4. BaseObservable
  5. Named
  6. Source
  7. AnyRef
  8. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Abstract Value Members

  1. abstract def addExternalObserver(observer: Observer[A], owner: Owner): Subscription
    Attributes
    protected[this]
    Definition Classes
    BaseObservable
  2. abstract def addInternalObserver(observer: InternalObserver[A], 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
    BaseObservable
  3. abstract def addObserver(observer: Observer[A])(implicit owner: Owner): Subscription

    Subscribe an external observer to this observable

    Subscribe an external observer to this observable

    Definition Classes
    BaseObservable
  4. abstract def numAllObservers: Int

    Total number of internal and external observers

    Total number of internal and external observers

    Attributes
    protected
    Definition Classes
    BaseObservable
  5. abstract def onWillStart(): Unit

    When starting an observable, this is called recursively on every one of its parents that are not started.

    When starting an observable, this is called recursively on every one of its parents that are not started. This whole chain happens before onStart callback is called. This chain serves to prepare the internal states of observables that are about to start, e.g. you should update the signal's value to match its parent signal's value in this callback, if applicable.

    Default implementation, for observables that don't need anything, should be to call parent.maybeWillStart() for every parent observable.

    If custom behaviour is required, you should generally call parent.maybeWillStart() BEFORE your custom logic. Then your logic will be able to make use of parent's updated value.

    Note: THIS METHOD MUST NOT CREATE TRANSACTIONS OR FIRE ANY EVENTS! DO IT IN ONSTART IF NEEDED.

    Attributes
    protected
    Definition Classes
    BaseObservable
  6. abstract def removeExternalObserverNow(observer: Observer[A]): Unit
    Attributes
    protected[airstream]
    Definition Classes
    BaseObservable
  7. abstract def removeInternalObserverNow(observer: InternalObserver[A]): Unit

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

    Child observable should call removeInternalObserver(parent, 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
    BaseObservable
  8. 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. 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 collect[B](pf: PartialFunction[A, B]): EventStream[B]

    Apply pf to event and emit the resulting value, or emit nothing if pf is not defined for that event.

    Apply pf to event and emit the resulting value, or emit nothing if pf is not defined for that event.

    pf

    Note: guarded against exceptions

  7. def collectOpt[B](fn: (A) => Option[B]): EventStream[B]

    Apply fn to parent stream event, and emit resulting x if it returns Some(x)

    Apply fn to parent stream event, and emit resulting x if it returns Some(x)

    fn

    Note: guarded against exceptions

  8. def collectSome[B](implicit ev: <:<[A, Option[B]]): EventStream[B]

    Emit x if parent stream emits Some(x), nothing otherwise

  9. def compose[B](operator: (EventStream[A]) => EventStream[B]): EventStream[B]
  10. def debounce(ms: Int): EventStream[A]

    See docs for DebounceStream

  11. def debugWith(debugger: Debugger[A]): EventStream[A]

    See also debug convenience method in BaseObservable

    See also debug convenience method in BaseObservable

    Definition Classes
    EventStreamBaseObservable
  12. 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
  13. def delay(ms: Int = 0): EventStream[A]

    ms

    milliseconds of delay

  14. def delaySync(after: EventStream[_]): EventStream[A]

    Make a stream that emits this stream's values but waits for after stream to emit first in a given transaction.

    Make a stream that emits this stream's values but waits for after stream to emit first in a given transaction. You can use this for Signals too with Signal.composeChanges (see docs for more details)

  15. final def displayName: String
    Definition Classes
    Named
  16. def distinct: EventStream[A]

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

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

    Definition Classes
    BaseObservable
  17. def distinctBy(key: (A) => Any): EventStream[A]

    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
  18. def distinctByFn(isSame: (A, A) => Boolean): EventStream[A]

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

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

    Definition Classes
    BaseObservable
  19. def distinctByRef(implicit ev: <:<[A, AnyRef]): EventStream[A]

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

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

    Definition Classes
    BaseObservable
  20. def distinctErrors(isSame: (Throwable, Throwable) => Boolean): EventStream[A]

    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
  21. def distinctTry(isSame: (Try[A], Try[A]) => Boolean): EventStream[A]

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

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

    Definition Classes
    EventStreamBaseObservable
  22. def drop(numEvents: Int, resetOnStop: Boolean = false): EventStream[A]

    Drop (skip) the first numEvents events from this stream.

    Drop (skip) the first numEvents events from this stream. Note: errors are NOT dropped.

    resetOnStop

    Reset the count if the stream stops

  23. def dropUntil(passes: (A) => Boolean, resetOnStop: Boolean = false): EventStream[A]

    Drop (skip) events from this stream as long as they do NOT pass the test (as soon as they start passing, stop dropping) Note: errors are NOT dropped.

    Drop (skip) events from this stream as long as they do NOT pass the test (as soon as they start passing, stop dropping) Note: errors are NOT dropped.

    passes

    Note: MUST NOT THROW!

    resetOnStop

    Forget everything and start dropping again if the stream stops

  24. def dropWhile(passes: (A) => Boolean, resetOnStop: Boolean = false): EventStream[A]

    Drop (skip) events from this stream as long as they pass the test (as soon as they stop passing, stop dropping) Note: errors are NOT dropped.

    Drop (skip) events from this stream as long as they pass the test (as soon as they stop passing, stop dropping) Note: errors are NOT dropped.

    passes

    Note: MUST NOT THROW!

    resetOnStop

    Forget everything and start dropping again if the stream stops

  25. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  26. 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
  27. def filter(passes: (A) => Boolean): EventStream[A]

    passes

    Note: guarded against exceptions

  28. def filterNot(predicate: (A) => Boolean): EventStream[A]
  29. def filterWith[B](source: SignalSource[B], passes: (B) => Boolean): EventStream[A]

    stream.filterWith(otherSignal, passes = _ == false) is essentially like stream.filter(_ => otherSignal.now() == false) (but it compiles)

  30. def flatMap[B, Inner[_], Output[+_] <: Observable[_]](compose: (A) => Inner[B])(implicit strategy: FlattenStrategy[[+_]EventStream[_], Inner, Output]): Output[B]

    compose

    Note: guarded against exceptions

    Definition Classes
    BaseObservable
    Annotations
    @inline()
  31. def foreach(onNext: (A) => 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. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  36. val isSafeToRemoveObserver: Boolean
    Attributes
    protected
    Definition Classes
    BaseObservable
  37. def isStarted: Boolean
    Attributes
    protected
    Definition Classes
    BaseObservable
  38. def map[B](project: (A) => B): EventStream[B]

    project

    Note: guarded against exceptions

    Definition Classes
    EventStreamBaseObservable
  39. def mapTo[B](value: => B): EventStream[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
  40. def mapToStrict[B](value: B): EventStream[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
  41. def mapToUnit: EventStream[Unit]
    Definition Classes
    BaseObservable
  42. def matchStreamOrSignal[B](ifStream: (EventStream[A]) => B, ifSignal: (Signal[A]) => B): B
    Definition Classes
    BaseObservable
  43. 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
  44. 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
  45. def maybeWillStart(): Unit
    Attributes
    protected
    Definition Classes
    BaseObservable
  46. def mergeWith[B >: A](streams: EventStream[B]*): EventStream[B]

    Returns a stream that emits events from this stream AND all off the streams, interleaved.

    Returns a stream that emits events from this stream AND all off the streams, interleaved. Note: For other types of combination, see combineWith, withCurrentValueOf, sample etc.

  47. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  48. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  49. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  50. def onAddedExternalObserver(observer: Observer[A]): Unit

    This is used in Signal-s.

    This is used in Signal-s. It's a no-op for Streams.

    Attributes
    protected
    Definition Classes
    EventStreamBaseObservable
  51. def onStart(): Unit

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

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

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

    Attributes
    protected
    Definition Classes
    BaseObservable
  52. 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
    Definition Classes
    BaseObservable
  53. implicit def protectedAccessEvidence: Protected
    Attributes
    protected
    Definition Classes
    BaseObservable
    Annotations
    @inline()
  54. def recover[B >: A](pf: PartialFunction[Throwable, Option[B]]): EventStream[B]

    See docs for MapStream

    See docs for MapStream

    pf

    Note: guarded against exceptions

    Definition Classes
    EventStreamBaseObservable
  55. def recoverIgnoreErrors: EventStream[A]
    Definition Classes
    BaseObservable
  56. def recoverToTry: EventStream[Try[A]]

    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
    EventStreamBaseObservable
  57. def removeExternalObserver(observer: Observer[A]): 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
  58. def removeInternalObserver(observer: InternalObserver[A]): 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
  59. def scanLeft[B](initial: B)(fn: (B, A) => B): Signal[B]

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

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

    fn

    Note: guarded against exceptions

  60. def scanLeftRecover[B](initial: Try[B])(fn: (Try[B], Try[A]) => Try[B]): Signal[B]

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

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

    fn

    Note: Must not throw!

  61. def setDisplayName(name: String): EventStream.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
  62. def startWith[B >: A](initial: => B, cacheInitialValue: Boolean = false): Signal[B]

    cacheInitialValue

    if false, signal's initial value will be re-evaluated on every restart (so long as the parent stream does not emit any values)

    Annotations
    @inline()
  63. def startWithNone: Signal[Option[A]]
    Annotations
    @inline()
  64. def startWithTry[B >: A](initial: => Try[B], cacheInitialValue: Boolean = false): Signal[B]

    cacheInitialValue

    if false, signal's initial value will be re-evaluated on every restart (so long as the parent stream does not emit any values)

    Annotations
    @inline()
  65. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  66. def take(numEvents: Int, resetOnStop: Boolean = false): EventStream[A]

    Take the first numEvents events from this stream, ignore the rest.

    Take the first numEvents events from this stream, ignore the rest. Note: As long as events are being taken, ALL errors are also taken

    resetOnStop

    Reset the count if the stream stops

  67. def takeUntil(passes: (A) => Boolean, resetOnStop: Boolean = false): EventStream[A]

    Imitate parent stream as long as events to NOT pass the test; stop emitting after that.

    Imitate parent stream as long as events to NOT pass the test; stop emitting after that.

    passes

    Note: MUST NOT THROW!

    resetOnStop

    Forget everything and start dropping again if the stream stops

  68. def takeWhile(passes: (A) => Boolean, resetOnStop: Boolean = false): EventStream[A]

    Imitate parent stream as long as events pass the test; stop emitting after that.

    Imitate parent stream as long as events pass the test; stop emitting after that.

    passes

    Note: MUST NOT THROW!

    resetOnStop

    Forget everything and start dropping again if the stream stops

  69. def throttle(ms: Int, leading: Boolean = true): EventStream[A]

    See docs for ThrottleStream

  70. def throwFailure[B](implicit ev: <:<[A, Try[B]]): EventStream[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
  71. def toObservable: EventStream[A]
    Definition Classes
    EventStreamEventSourceSource
  72. def toSignal[B >: A](initial: => B, cacheInitialValue: Boolean = false): Signal[B]

    cacheInitialValue

    if false, signal's initial value will be re-evaluated on every restart (so long as the parent stream does not emit any values)

  73. def toSignalIfStream[B >: A](ifStream: (EventStream[A]) => Signal[B]): Signal[B]
    Definition Classes
    BaseObservable
  74. def toSignalWithTry[B >: A](initial: => Try[B], cacheInitialValue: Boolean = false): Signal[B]

    cacheInitialValue

    if false, signal's initial value will be re-evaluated on every restart (so long as the parent stream does not emit any values)

  75. def toStreamIfSignal[B >: A](ifSignal: (Signal[A]) => EventStream[B]): EventStream[B]
    Definition Classes
    BaseObservable
  76. 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
  77. def toWeakSignal: Signal[Option[A]]

    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
  78. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  79. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  80. 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](initial: B)(fn: (B, A) => B): Signal[B]
    Annotations
    @deprecated
    Deprecated

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

  3. def foldLeftRecover[B](initial: Try[B])(fn: (Try[B], Try[A]) => Try[B]): Signal[B]
    Annotations
    @deprecated
    Deprecated

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

Inherited from EventSource[A]

Inherited from Observable[A]

Inherited from BaseObservable[[+_]EventStream[_], A]

Inherited from Named

Inherited from Source[A]

Inherited from AnyRef

Inherited from Any

Ungrouped