com.raquo.airstream.flatten

Members list

Type members

Classlikes

trait AllowFlatMap

Attributes

Supertypes
class Object
trait Matchable
class Any
trait AllowFlatten

Attributes

Supertypes
class Object
trait Matchable
class Any

This is essentially a dynamic version of EventStream.merge.

This is essentially a dynamic version of EventStream.merge.

  • The resulting stream re-emits all the events emitted by all of the streams previously emitted by the input observable.
  • If you restart the resulting stream, it will remember and resubscribe to all of the streams it previously listened to.
  • If the input observable emits the same stream more than once, that stream will only be added once.

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
trait FlattenStrategy[-Outer <: (Observable), -Inner[_], +Output <: (Observable)]()

Specifies how to flatten observables of observables.

Specifies how to flatten observables of observables.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait MergingStrategy[Outer, Inner, Output]
trait SwitchingStrategy[Outer, Inner, Output]
object SwitchSignalStrategy.type
object SwitchStreamStrategy.type
Show all

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
trait MergingStrategy[-Outer <: (Observable), -Inner[_], +Output <: (Observable)]() extends FlattenStrategy[Outer, Inner, Output]

Flatten strategies with semantics of merging all of the emitted observables.

Flatten strategies with semantics of merging all of the emitted observables.

Attributes

Supertypes
trait FlattenStrategy[Outer, Inner, Output]
class Object
trait Matchable
class Any
Known subtypes
class SwitchSignal[A](parent: Signal[Signal[A]]) extends WritableSignal[A], InternalTryObserver[Signal[A]]

This flattens a Signal[ Signal[A] ] into a Signal[A]

This flattens a Signal[ Signal[A] ] into a Signal[A]

When this signal is started, its current value tracks the current value of the last signal emitted by parent.

Attributes

Supertypes
trait WritableSignal[A]
trait Signal[A]
trait SignalSource[A]
trait Observable[A]
trait Named
trait Source[A]
class Object
trait Matchable
class Any
Show all

This flattens an EventStream [ Signal[A] ] into an EventStream[A]

This flattens an EventStream [ Signal[A] ] into an EventStream[A]

When this stream is started, it re-emits the current value of the last signal emitted by parent (including any updates to it, until it switches to the next signal).

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 SwitchStream[I, O](parent: Observable[I], makeStream: I => EventStream[O]) extends WritableStream[O], InternalNextErrorObserver[I]

parent observable emits values that we convert into streams using makeStream.

parent observable emits values that we convert into streams using makeStream.

This stream emits the events from the last such stream created this way.

Events are emitted at the same time as the currently tracked stream emits them (but in a new transaction).

When parent emits a nextValue, this stream switches to emitting events from makeStream(nextValue) (which is a stream).

If parent stream emits an error, this stream re-emits that error and unsubscribes from the last emitted stream

If the stream created with makeStream emits an error, this stream re-emits it in a new transaction.

If parent is a signal in a failed state when SwitchEventStream is created, parent's error is re-emitted in a new transaction, as if makeStream returned a stream that emitted this error.

Warning: Similar to com.raquo.airstream.eventbus.EventBus, this stream emits events in a new transaction because its proper topoRank would need to be dynamic, which we don't support.

Value parameters

makeStream

Note: Must not throw

Attributes

Supertypes
trait InternalObserver[I]
trait WritableStream[O]
trait EventStream[O]
trait EventSource[O]
trait Observable[O]
trait Named
trait Source[O]
class Object
trait Matchable
class Any
Show all
trait SwitchingStrategy[-Outer <: (Observable), -Inner[_], +Output <: (Observable)]() extends FlattenStrategy[Outer, Inner, Output]

Flatten strategies with semantics of mirroring the latest emitted observable.

Flatten strategies with semantics of mirroring the latest emitted observable.

Attributes

Supertypes
trait FlattenStrategy[Outer, Inner, Output]
class Object
trait Matchable
class Any
Known subtypes