Signal

reactives.operator.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: 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 def observe(onValue: T => Unit, onError: (Throwable => Unit) | Null, fireImmediately: Boolean)(using ticket: CreationTicket[State]): Disconnectable

add an observer

add an observer

Attributes

final def readValueOnce: 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](using flatten: Flatten[Signal[T], R]): R

Flattens the inner value.

Flattens the inner value.

Attributes

final inline def map[B](inline expression: T => B)(using CreationTicket[State]): 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)(using 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(using 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(using 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

Type members

Types

override type State[V] = ParRPState[V]

Additional structure required by schedulers for their propagation. For example, outgoing dependencies, multi-versioned values, locks.

Additional structure required by schedulers for their propagation. For example, outgoing dependencies, multi-versioned values, locks.

Attributes

override type Value <: Pulse[T]

The type of the time-changing Value contained in this ReSource

The type of the time-changing Value contained in this ReSource

Attributes

Value members

Concrete methods

final def abortOnError(message: String)(using 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

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
final def recover[R >: T](onFailure: PartialFunction[Throwable, R])(using 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 and Abstract methods

def disconnect(): Unit

Attributes

Inherited from:
Disconnectable
def info: ReInfo

Developer friendly information about the resource.

Developer friendly information about the resource.

Attributes

Inherited from:
ReSource

Givens

Givens

given given_Conversion_Value_T: Conversion[Value, T]