EitherStream

com.raquo.airstream.extensions.EitherStream
final class EitherStream[A, B](val stream: EventStream[Either[A, B]]) extends AnyVal

See also: EitherObservable

Attributes

Graph
Supertypes
class AnyVal
trait Matchable
class Any

Members list

Value members

Concrete methods

Emit x if parent stream emits Left(x), do nothing otherwise

Emit x if parent stream emits Left(x), do nothing otherwise

Attributes

def collectLeft[C](pf: PartialFunction[A, C]): EventStream[C]

Emit pf(x) if parent stream emits Left(x) and pf is defined for x, do nothing otherwise

Emit pf(x) if parent stream emits Left(x) and pf is defined for x, do nothing otherwise

Attributes

Emit x if parent stream emits Right(x), do nothing otherwise

Emit x if parent stream emits Right(x), do nothing otherwise

Attributes

def collectRight[C](pf: PartialFunction[B, C]): EventStream[C]

Emit pf(x) if parent stream emits Right(x) and pf is defined for x, do nothing otherwise

Emit pf(x) if parent stream emits Right(x) and pf is defined for x, do nothing otherwise

Attributes

def splitEither[C](left: (A, Signal[A]) => C, right: (B, Signal[B]) => C): EventStream[C]

This .split-s a stream of Either-s by their isRight property. If you want a different key, use the .splitOne operator directly.

This .split-s a stream of Either-s by their isRight property. If you want a different key, use the .splitOne operator directly.

Value parameters

left

(initialLeft, signalOfLeftValues) => output left is called whenever stream switches from Right() to Left(). signalOfLeftValues starts with initialLeft value, and updates when the parent stream updates from Left(a) toLeft(b)`.

right

(initialRight, signalOfRightValues) => output right is called whenever stream switches from Left() to Right(). signalOfRightValues starts with initialRight value, and updates when the parent stream updates from Right(a) to Right(b).

Attributes

Concrete fields

val stream: EventStream[Either[A, B]]