com.raquo.airstream.timing

Members list

Type members

Classlikes

class DebounceStream[A](val parent: EventStream[A], intervalMs: Int) extends SingleParentStream[A, A], InternalTryObserver[A]

This stream emits the last event emitted by parent, but only after intervalMs has elapsed since parent emitted the previous event.

This stream emits the last event emitted by parent, but only after intervalMs has elapsed since parent emitted the previous event.

Essentially, this stream emits the parent's last event, but only once the parent stops emitting events for intervalMs.

When stopped, this stream "forgets" about any pending events.

See also ThrottleStream

Attributes

Supertypes
trait SingleParentStream[A, A]
trait InternalObserver[A]
trait WritableStream[A]
trait EventStream[A]
trait EventSource[A]
trait Observable[A]
trait Named
trait Source[A]
class Object
trait Matchable
class Any
Show all
class DelayStream[A](val parent: EventStream[A], delayMs: Int) extends SingleParentStream[A, A], InternalNextErrorObserver[A]

Attributes

Supertypes
trait SingleParentStream[A, A]
trait InternalObserver[A]
trait WritableStream[A]
trait EventStream[A]
trait EventSource[A]
trait Observable[A]
trait Named
trait Source[A]
class Object
trait Matchable
class Any
Show all
class JsPromiseSignal[A](promise: Promise[A]) extends WritableSignal[Option[A]]

Attributes

Supertypes
trait WritableSignal[Option[A]]
trait WritableObservable[Option[A]]
trait Signal[Option[A]]
trait SignalSource[Option[A]]
trait Observable[Option[A]]
trait BaseObservable[Signal, Option[A]]
trait Named
trait Source[Option[A]]
class Object
trait Matchable
class Any
Show all
class JsPromiseStream[A](promise: Promise[A], emitOnce: Boolean) extends WritableStream[A]

This stream emits a value that the promise resolves with, even if the promise was already resolved.

This stream emits a value that the promise resolves with, even if the promise was already resolved.

This stream emits only once. If you want to remember the value, Use JsPromiseSignal instead.

Value parameters

promise

Note: guarded against failures

Attributes

Supertypes
trait WritableStream[A]
trait EventStream[A]
trait EventSource[A]
trait Observable[A]
trait Named
trait Source[A]
class Object
trait Matchable
class Any
Show all
class PeriodicStream[A](initial: A, next: A => Option[(A, Int)], resetOnStop: Boolean) extends WritableStream[A]

Value parameters

next

(currentState => (nextState, nextIntervalMs) Note: guarded against exceptions. If next throws, stream will emit that error

Attributes

Supertypes
trait WritableStream[A]
trait EventStream[A]
trait EventSource[A]
trait Observable[A]
trait Named
trait Source[A]
class Object
trait Matchable
class Any
Show all
class SyncDelayStream[A](val parent: Observable[A], after: Observable[_]) extends SingleParentStream[A, A], InternalTryObserver[A], SyncObservable[A]

Note: This is generally supposed to be used only with streams as inputs. Make sure you know what you're doing if using signals.

Note: This is generally supposed to be used only with streams as inputs. Make sure you know what you're doing if using signals.

  • if parent is a Signal, this stream mirrors parent.changes, not parent.
  • if after is a Signal, this stream ignores its initial value

Attributes

Supertypes
trait SyncObservable[A]
trait SingleParentStream[A, A]
trait InternalObserver[A]
trait WritableStream[A]
trait EventStream[A]
trait EventSource[A]
trait Observable[A]
trait Named
trait Source[A]
class Object
trait Matchable
class Any
Show all
class ThrottleStream[A](val parent: EventStream[A], intervalMs: Int, leading: Boolean) extends SingleParentStream[A, A], InternalTryObserver[A]

ThrottleStream emits at most one event per intervalMs.

ThrottleStream emits at most one event per intervalMs.

  • All events are emitted in a new transaction, after an async delay, even if the delay is zero ms
  • Any incoming event is scheduled to be emitted as soon as possible, but no sooner than intervalMs after the last event that was actually emitted by the throttled stream
  • When an event is scheduled to be emitted, any event that was previously scheduled is cancelled (that's the nature of throttling, you only get at most one event within intervalMs)
  • Errors are propagated in the same manner
  • Stopping the stream cancels scheduled events and makes it forget everything that happened before.

See also See also DebounceStream

Attributes

Supertypes
trait SingleParentStream[A, A]
trait InternalObserver[A]
trait WritableStream[A]
trait EventStream[A]
trait EventSource[A]
trait Observable[A]
trait Named
trait Source[A]
class Object
trait Matchable
class Any
Show all