EventStream

com.raquo.airstream.core.EventStream
See theEventStream companion trait
object EventStream

Attributes

Companion
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def combineSeq[A](streams: Seq[EventStream[A]]): EventStream[Seq[A]]
def delay(ms: Int): EventStream[Unit]

Emit () with a delay (ms milliseconds after stream is started)

Emit () with a delay (ms milliseconds after stream is started)

Attributes

def delay[A](ms: Int, event: A, emitOnce: Boolean): EventStream[A]

Emit event with a delay (ms milliseconds after stream is started)

Emit event with a delay (ms milliseconds after stream is started)

Attributes

def fromCustomSource[A](shouldStart: StartIndex => Boolean, start: (() => A, FireError, GetStartIndex, GetIsStarted) => Unit, stop: StartIndex => Unit): EventStream[A]

Easy helper for custom events. See CustomStreamSource for docs.

Easy helper for custom events. See CustomStreamSource for docs.

Provide start and stop callbacks that will be called when the stream is started and stopped. E.g. create some resource on start, clean it on stop.

The arguments to start are functions. Call them to do things like emit an event, emit an error, or get some info:

getStartIndex returns 1 the first time the signal is started, and is incremented every time it is started again after being stopped.

getIsStarted is a function that you can call any time, including after some delay, to check if the signal is still started, e.g. if you don't want to update the signal's value if the signal is stopped.

Value parameters

stop

MUST NOT THROW!

Attributes

def fromEither[A](value: Either[Throwable, A], emitOnce: Boolean): EventStream[A]

Value parameters

emitOnce

if true, the event will be emitted at most one time. If false, the event will be emitted every time the stream is started.

Attributes

def fromFuture[A](future: Future[A], emitOnce: Boolean)(implicit ec: ExecutionContext): EventStream[A]
def fromJsPromise[A](promise: Promise[A], emitOnce: Boolean): EventStream[A]
def fromSeq[A](events: Seq[A], emitOnce: Boolean): EventStream[A]

Value parameters

emitOnce

if true, the event will be emitted at most one time. If false, the event will be emitted every time the stream is started.

Attributes

def fromTry[A](value: Try[A], emitOnce: Boolean): EventStream[A]

Value parameters

emitOnce

if true, the event will be emitted at most one time. If false, the event will be emitted every time the stream is started.

Attributes

def fromValue[A](event: A, emitOnce: Boolean): EventStream[A]

Value parameters

emitOnce

if true, the event will be emitted at most one time. If false, the event will be emitted every time the stream is started.

Attributes

def merge[A](streams: EventStream[A]*): EventStream[A]

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

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

Attributes

def mergeSeq[A](streams: Seq[EventStream[A]]): EventStream[A]
def periodic(intervalMs: Int, resetOnStop: Boolean): PeriodicStream[Int]
def sequence[A](streams: Seq[EventStream[A]]): EventStream[Seq[A]]
def unit(emitOnce: Boolean): EventStream[Unit]
def withCallback[A]: (EventStream[A], A => Unit)

Create a stream and a callback that, when fired, makes that stream emit.

Create a stream and a callback that, when fired, makes that stream emit.

Attributes

def withJsCallback[A]: (EventStream[A], Function1[A, Unit])

Create a stream and a JS callback that, when fired, makes that stream emit.

Create a stream and a JS callback that, when fired, makes that stream emit.

Attributes

def withObserver[A]: (EventStream[A], Observer[A])

Create a stream and an observer that, when receiving an event or an error, makes that stream emit.

Create a stream and an observer that, when receiving an event or an error, makes that stream emit.

Attributes

def withUnitCallback: (EventStream[Unit], () => Unit)

Create a stream of Unit, and a callback that, when fired, makes that stream emit.

Create a stream of Unit, and a callback that, when fired, makes that stream emit.

Attributes

Concrete fields

val empty: EventStream[Nothing]

Event stream that never emits anything

Event stream that never emits anything

Attributes

Implicits

Implicits

implicit def toBooleanStream[A](stream: EventStream[Boolean]): BooleanStream

Provides methods on stream: splitBoolean

Provides methods on stream: splitBoolean

Attributes

implicit def toCombinableStream[A](stream: EventStream[A]): CombinableStream[A]

Provides methods on EventStream: combine, combineWith, withCurrentValueOf, sample

Provides methods on EventStream: combine, combineWith, withCurrentValueOf, sample

Attributes

implicit def toDebuggableStream[A](stream: EventStream[A]): DebuggableStream[A]

Provides debug* methods on EventStream: debugSpy, debugLogEvents, debugBreakErrors, etc.

Provides debug* methods on EventStream: debugSpy, debugLogEvents, debugBreakErrors, etc.

Attributes

implicit def toEitherStream[A, B](stream: EventStream[Either[A, B]]): EitherStream[A, B]

Provides methods on stream: collectLeft, collectRight

Provides methods on stream: collectLeft, collectRight

Attributes

Provides methods on EventStream companion object: combine, combineWith

Provides methods on EventStream companion object: combine, combineWith

Attributes

implicit def toOptionStream[A](stream: EventStream[Option[A]]): OptionStream[A]

Provides methods on stream: filterSome, collectSome, splitOption

Provides methods on stream: filterSome, collectSome, splitOption

Attributes

implicit def toSplittableOneStream[A](stream: EventStream[A]): SplittableOneStream[A]

Provides methods on EventStream: splitOne

Provides methods on EventStream: splitOne

Attributes

implicit def toSplittableStream[M[_], Input](stream: EventStream[M[Input]]): SplittableStream[M, Input]

Provides methods on EventStream: split, splitByIndex

Provides methods on EventStream: split, splitByIndex

Attributes

implicit def toStatusStream[In, Out](stream: EventStream[Status[In, Out]]): StatusStream[In, Out]

Provides methods on stream: collectOutput, collectResolved, collectPending, collectPendingInput, splitStatus

Provides methods on stream: collectOutput, collectResolved, collectPending, collectPendingInput, splitStatus

Attributes

implicit def toTryStream[A](stream: EventStream[Try[A]]): TryStream[A]

Provides methods on stream: collectFailure, collectSuccess

Provides methods on stream: collectFailure, collectSuccess

Attributes

implicit def toTupleStream2[T1, T2](stream: EventStream[(T1, T2)]): TupleStream2[T1, T2]
implicit def toTupleStream3[T1, T2, T3](stream: EventStream[(T1, T2, T3)]): TupleStream3[T1, T2, T3]
implicit def toTupleStream4[T1, T2, T3, T4](stream: EventStream[(T1, T2, T3, T4)]): TupleStream4[T1, T2, T3, T4]
implicit def toTupleStream5[T1, T2, T3, T4, T5](stream: EventStream[(T1, T2, T3, T4, T5)]): TupleStream5[T1, T2, T3, T4, T5]
implicit def toTupleStream6[T1, T2, T3, T4, T5, T6](stream: EventStream[(T1, T2, T3, T4, T5, T6)]): TupleStream6[T1, T2, T3, T4, T5, T6]
implicit def toTupleStream7[T1, T2, T3, T4, T5, T6, T7](stream: EventStream[(T1, T2, T3, T4, T5, T6, T7)]): TupleStream7[T1, T2, T3, T4, T5, T6, T7]
implicit def toTupleStream8[T1, T2, T3, T4, T5, T6, T7, T8](stream: EventStream[(T1, T2, T3, T4, T5, T6, T7, T8)]): TupleStream8[T1, T2, T3, T4, T5, T6, T7, T8]
implicit def toTupleStream9[T1, T2, T3, T4, T5, T6, T7, T8, T9](stream: EventStream[(T1, T2, T3, T4, T5, T6, T7, T8, T9)]): TupleStream9[T1, T2, T3, T4, T5, T6, T7, T8, T9]