OptionStream

com.raquo.airstream.extensions.OptionStream
final class OptionStream[A](val stream: EventStream[Option[A]]) extends AnyVal

See also: OptionObservable

Attributes

Graph
Supertypes
class AnyVal
trait Matchable
class Any

Members list

Value members

Concrete methods

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

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

Attributes

def collectSome[B](pf: PartialFunction[A, B]): EventStream[B]

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

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

Attributes

def splitOption[B](project: (A, Signal[A]) => B, ifEmpty: => B): Signal[B]

This .split-s a Stream of an Option by the Option's isDefined property. If you want a different key, use the .split operator directly.

This .split-s a Stream of an Option by the Option's isDefined property. If you want a different key, use the .split operator directly.

Value parameters

ifEmpty
  • returned if Option is empty, or if the parent stream has not emitted any events yet. Re-evaluated whenever the parent stream switches from Some(a) to None. ifEmpty is NOT re-evaluated when the parent stream emits None if the last event it emitted was also a None.
project
  • (initialInput, signalOfInput) => output project is called whenever the parent signal switches from None to Some(). signalOfInput starts with initialInput value, and updates when the parent stream updates from Some(a) to Some(b).

Attributes

Concrete fields

val stream: EventStream[Option[A]]