Signal

com.raquo.airstream.core.Signal
See theSignal companion trait
object Signal

Attributes

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

Members list

Value members

Concrete methods

def combineSeq[A](signals: Seq[Signal[A]]): Signal[Seq[A]]
def fromCustomSource[A](initial: => Try[A], start: (() => A, () => A, GetStartIndex, GetIsStarted) => Unit, stop: StartIndex => Unit): Signal[A]

Easy helper for custom signals. See CustomSignalSource for docs.

Easy helper for custom signals. See CustomSignalSource for docs.

Provide start and stop callbacks that will be called when the signal 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 update the signal's value, read its current value, 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]): Val[A]
def fromFuture[A](future: Future[A])(implicit ec: ExecutionContext): Signal[Option[A]]

The signal will start with None, even if the future is already resolved. Once the future resolves (or after a minimal async delay if it's already resolved), the signal's value will be updated to the future's resolved value.

The signal will start with None, even if the future is already resolved. Once the future resolves (or after a minimal async delay if it's already resolved), the signal's value will be updated to the future's resolved value.

Attributes

def fromFuture[A](future: Future[A], initial: => A)(implicit ec: ExecutionContext): Signal[A]

The signal will start with the provided initial value, even if the future is already resolved. Once the future resolves (or after a minimal async delay if it's already resolved), the signal's value will be updated to the future's resolved value.

The signal will start with the provided initial value, even if the future is already resolved. Once the future resolves (or after a minimal async delay if it's already resolved), the signal's value will be updated to the future's resolved value.

Attributes

def fromJsPromise[A](promise: Promise[A]): Signal[Option[A]]

The signal will start with None, even if the promise is already resolved. Once the promise resolves (or after a minimal async delay if it's already resolved), the signal's value will be updated to the promise's resolved value.

The signal will start with None, even if the promise is already resolved. Once the promise resolves (or after a minimal async delay if it's already resolved), the signal's value will be updated to the promise's resolved value.

Attributes

def fromJsPromise[A](promise: Promise[A], initial: => A): Signal[A]

The signal will start with the provided initial value, even if the promise is already resolved. Once the promise resolves (or after a minimal async delay if it's already resolved), the signal's value will be updated to the promise's resolved value.

The signal will start with the provided initial value, even if the promise is already resolved. Once the promise resolves (or after a minimal async delay if it's already resolved), the signal's value will be updated to the promise's resolved value.

Attributes

def fromTry[A](value: Try[A]): Val[A]
def fromValue[A](value: A): Val[A]
def nextUpdateId(): Int
def sequence[A](signals: Seq[Signal[A]]): Signal[Seq[A]]

Implicits

Implicits

implicit def toBooleanSignal(signal: Signal[Boolean]): BooleanSignal

Provides methods on Signal: splitBoolean

Provides methods on Signal: splitBoolean

Attributes

implicit def toCombinableSignal[A](signal: Signal[A]): CombinableSignal[A]

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

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

Attributes

implicit def toDebuggableSignal[A](signal: Signal[A]): DebuggableSignal[A]

Provides signal-specific debug* methods: debugSpyInitialEval, debugLogInitialEval, debugBreakInitialEval

Provides signal-specific debug* methods: debugSpyInitialEval, debugLogInitialEval, debugBreakInitialEval

Attributes

implicit def toEitherSignal[A, B](signal: Signal[Either[A, B]]): EitherSignal[A, B]

Provides methods on Signal: splitEither

Provides methods on Signal: splitEither

Attributes

implicit def toOptionSignal[A](signal: Signal[Option[A]]): OptionSignal[A]

Provides methods on Signal: splitOption

Provides methods on Signal: splitOption

Attributes

Provides methods on Signal companion object: combine, combineWith

Provides methods on Signal companion object: combine, combineWith

Attributes

implicit def toSplittableOneSignal[A](signal: Signal[A]): SplittableOneSignal[A]

Provides methods on Signal: splitOne

Provides methods on Signal: splitOne

Attributes

implicit def toSplittableSignal[M[_], Input](signal: Signal[M[Input]]): SplittableSignal[M, Input]

Provides methods on Signal: split, splitByIndex

Provides methods on Signal: split, splitByIndex

Attributes

implicit def toStatusSignal[In, Out](signal: Signal[Status[In, Out]]): StatusSignal[In, Out]

Provides methods on Signal: splitStatus

Provides methods on Signal: splitStatus

Attributes

implicit def toTrySignal[A](signal: Signal[Try[A]]): TrySignal[A]

Provides methods on Signal: splitTry

Provides methods on Signal: splitTry

Attributes

implicit def toTupleSignal2[T1, T2](stream: Signal[(T1, T2)]): TupleSignal2[T1, T2]
implicit def toTupleSignal3[T1, T2, T3](stream: Signal[(T1, T2, T3)]): TupleSignal3[T1, T2, T3]
implicit def toTupleSignal4[T1, T2, T3, T4](stream: Signal[(T1, T2, T3, T4)]): TupleSignal4[T1, T2, T3, T4]
implicit def toTupleSignal5[T1, T2, T3, T4, T5](stream: Signal[(T1, T2, T3, T4, T5)]): TupleSignal5[T1, T2, T3, T4, T5]
implicit def toTupleSignal6[T1, T2, T3, T4, T5, T6](stream: Signal[(T1, T2, T3, T4, T5, T6)]): TupleSignal6[T1, T2, T3, T4, T5, T6]
implicit def toTupleSignal7[T1, T2, T3, T4, T5, T6, T7](stream: Signal[(T1, T2, T3, T4, T5, T6, T7)]): TupleSignal7[T1, T2, T3, T4, T5, T6, T7]
implicit def toTupleSignal8[T1, T2, T3, T4, T5, T6, T7, T8](stream: Signal[(T1, T2, T3, T4, T5, T6, T7, T8)]): TupleSignal8[T1, T2, T3, T4, T5, T6, T7, T8]
implicit def toTupleSignal9[T1, T2, T3, T4, T5, T6, T7, T8, T9](stream: Signal[(T1, T2, T3, T4, T5, T6, T7, T8, T9)]): TupleSignal9[T1, T2, T3, T4, T5, T6, T7, T8, T9]