Signal

rescala.operator.SignalBundle.Signal
See theSignal companion object
trait Signal[+T] extends Disconnectable, MacroAccess[T], ReSource

Time changing value derived from the dependencies.

Type parameters

T

Type stored by the signal

Attributes

Companion
object
Graph
Supertypes
trait MacroAccess[T]
trait ReadAs[T]
trait ReSource
class Object
trait Matchable
class Any
Show all
Known subtypes
class Var[A]

Members list

Grouped members

accessor

final def now(implicit scheduler: Scheduler[State]): T

Returns the current value of the signal However, using now is in most cases not what you want. It does not build dependencies, does not integrate into transactions. Use only for examples and debug output.

Returns the current value of the signal However, using now is in most cases not what you want. It does not build dependencies, does not integrate into transactions. Use only for examples and debug output.

Attributes

final infix def observe(onValue: T => Unit, onError: Throwable => Unit, fireImmediately: Boolean)(implicit ticket: CreationTicket[State]): Disconnectable

add an observer

add an observer

Attributes

final def readValueOnce(implicit scheduler: Scheduler[State]): T

Returns the current value of the signal

Returns the current value of the signal

Attributes

final def value: T

Makes the enclosing reactive expression depend on the current value of the reactive.

Makes the enclosing reactive expression depend on the current value of the reactive.

Attributes

See also

apply

Inherited from:
MacroAccess

Signal operators

final def flatten[R](implicit flatten: Flatten[Signal[T], R]): R

Flattens the inner value.

Flattens the inner value.

Attributes

final infix inline def map[B](using CreationTicket[State])(inline expression: T => B): Signal[B]

Return a Signal with f applied to the value

Return a Signal with f applied to the value

Attributes

final def withDefault[R >: T](value: R)(implicit ticket: CreationTicket[State]): Signal[R]

Sets a default value in case this signal is empty.

Sets a default value in case this signal is empty.

Attributes

Signal to Event conversions

final def change(implicit ticket: CreationTicket[State]): Event[Diff[T]]

Create an event that fires every time the signal changes. It fires the tuple (oldVal, newVal) for the signal. Be aware that no change will be triggered when the signal changes to or from empty

Create an event that fires every time the signal changes. It fires the tuple (oldVal, newVal) for the signal. Be aware that no change will be triggered when the signal changes to or from empty

Attributes

final def changed(implicit ticket: CreationTicket[State]): Event[T]

Create an event that fires every time the signal changes. The value associated to the event is the new value of the signal

Create an event that fires every time the signal changes. The value associated to the event is the new value of the signal

Attributes

internal

override def read(v: Value): T

Interprets the internal type to the external type

Interprets the internal type to the external type

Attributes

Definition Classes

Type members

Types

override type State[V] = BundleState[V]
override type Value <: Pulse[T]

Value members

Concrete methods

final def abortOnError(message: String)(implicit ticket: CreationTicket[State]): Signal[T]

Adds another error message in case this signal is empty, also disallows handling exceptions in observers

Adds another error message in case this signal is empty, also disallows handling exceptions in observers

Attributes

final def recover[R >: T](onFailure: PartialFunction[Throwable, R])(implicit ticket: CreationTicket[State]): Signal[R]

Uses a partial function onFailure to recover an error carried by the event into a value.

Uses a partial function onFailure to recover an error carried by the event into a value.

Attributes

Inherited methods

def disconnect(): Unit

Attributes

Inherited from:
Disconnectable
def info: ReInfo

Attributes

Inherited from:
ReSource

Givens

Givens

given given_Conversion_Value_T: Conversion[Value, T]