RescalaInterface

rescala.interface.RescalaInterface

Rescala has two main abstractions. Event and Signal commonly referred to as reactives. Use Var to create signal sources and Evt to create event sources.

Events and signals can be created from other reactives by using combinators, signals additionally can be created using Signal expressions.

Attributes

Graph
Supertypes
Known subtypes
object sidup.type
object synchron.type
object toposort.type
object unmanaged.type
object default.type
object IncrementalApi.type

Members list

Concise view

Create new reactives

object Event

Similar to Signal expressions, but resulting in an event. Accessed events return options depending on whether they fire or not, and the complete result of the expression is an event as well.

Similar to Signal expressions, but resulting in an event. Accessed events return options depending on whether they fire or not, and the complete result of the expression is an event as well.

Attributes

See also:

Signal

Inherited from:
EventCompatBundle
Graph
Supertypes
class Object
trait Matchable
class Any
final def Evt[A]()(implicit ticket: CreationTicket): Evt[A]

Attributes

Inherited from:
Sources
object Signal

A signal expression can be used to create signals accessing arbitrary other signals. Use the apply method on a signal to access its value inside of a signal expression.

A signal expression can be used to create signals accessing arbitrary other signals. Use the apply method on a signal to access its value inside of a signal expression.

val a: Signal[Int]
val b: Signal[Int]
val result: Signal[String] = Signal { a().toString + b().toString}

Attributes

Inherited from:
SignalCompatBundle
Graph
Supertypes
class Object
trait Matchable
class Any
object Var

Creates new Vars

Creates new Vars

Attributes

Inherited from:
Sources
Graph
Supertypes
class Object
trait Matchable
class Any

Update multiple reactives

def transaction[R](initialWrites: of[State]*)(admissionPhase: AdmissionTicket[State] => R): R

Executes a transaction.

Executes a transaction.

Attributes

R

Result type of the admission function

admissionPhase

An admission function that may rescala.operator.Sources.Evt.admit / rescala.operator.Sources.Var.admit arbitrary input changes that will be applied as an atomic transaction at the end.

initialWrites

All inputs that might be changed by the transaction

Returns:

Result of the admission function

Example:

transaction(a, b){ implicit at => a.set(5); b.set(1); at.now(a) }

def transactionWithWrapup[I, R](iw: of[State]*)(ap: AdmissionTicket[State] => I)(wrapUp: (I, of[State]) => R): R

Executes a transaction with WrapUpPhase.

Executes a transaction with WrapUpPhase.

Attributes

See also:

transaction

Advanced functions used when extending REScala

Methods and type aliases for advanced usages, these are most relevant to abstract over multiple scheduler implementations.

Attributes

Attributes

Type members

Inherited classlikes

class ChangeEventImpl[T](_bud: State[(Pulse[T], Pulse[Diff[T]])], signal: Signal[T], name: ReInfo) extends Base[State, (Pulse[T], Pulse[Diff[T]])] with Derived with Event[Diff[T]] with DisconnectableImpl

Attributes

Inherited from:
DefaultImplementations
Graph
Supertypes
trait Event[Diff[T]]
trait EventCompat[Diff[T]]
trait ReadAs[State, Option[Diff[T]]]
trait Derived
class Base[State, (Pulse[T], Pulse[Diff[T]])]
trait ReSource
class Object
trait Matchable
class Any
abstract class DerivedImpl[T](initial: State[Pulse[T]], name: ReInfo, isDynamicWithStaticDeps: Option[Set[of[State]]]) extends Base[State, Pulse[T]] with Derived with DisconnectableImpl

Attributes

Inherited from:
DefaultImplementations
Graph
Supertypes
trait Derived
class Base[State, Pulse[T]]
trait ReSource
class Object
trait Matchable
class Any
Known subtypes
class EventImpl[T]
class SignalImpl[T]
trait Event[+T] extends EventCompat[T] with Disconnectable

Events only propagate a value when they are changing, when the system is at rest, events have no values.

Events only propagate a value when they are changing, when the system is at rest, events have no values.

Note: We hide implicit parameters of the API in the documentation. They are used to ensure correct creation, and you normally do not have to worry about them, except if you accidentally call the implicit parameter list, in which cas you may get cryptic errors. This is a scala limitation. We also hide the internal state parameter of passed and returned events.

Attributes

T

Value type of the event occurrences.

Inherited from:
EventBundle
Graph
Supertypes
trait EventCompat[T]
trait ReadAs[State, Option[T]]
trait ReSource
class Object
trait Matchable
class Any
Known subtypes
class EventImpl[T]
class Evt[T]
trait EventCompat[+T] extends ReadableMacro[State, Option[T]]

Attributes

Inherited from:
EventCompatBundle
Graph
Supertypes
trait ReadAs[State, Option[T]]
trait ReSource
class Object
trait Matchable
class Any
Known subtypes
trait Event[T]
class EventImpl[T]
class Evt[T]
class EventImpl[T](initial: State[Pulse[T]], expr: DynamicTicket => Pulse[T], name: ReInfo, isDynamicWithStaticDeps: Option[Set[of[State]]]) extends DerivedImpl[T] with Event[T]

Attributes

isDynamicWithStaticDeps

If this is None, the event is static. Else, it is dynamic with the set of static dependencies

Inherited from:
DefaultImplementations
Graph
Supertypes
trait Event[T]
trait EventCompat[T]
trait ReadAs[State, Option[T]]
class DerivedImpl[T]
trait Derived
class Base[State, Pulse[T]]
trait ReSource
class Object
trait Matchable
class Any
object Events

Attributes

Inherited from:
EventBundle
Graph
Supertypes
class Object
trait Matchable
class Any
class Evt[T] extends Base[State, Pulse[T]] with Source[T] with Event[T]

Source events with imperative occurrences

Source events with imperative occurrences

Attributes

S

Struct type used for the propagation of the event

T

Type returned when the event fires

initialState

of by the event

Inherited from:
Sources
Graph
Supertypes
trait Event[T]
trait EventCompat[T]
trait ReadAs[State, Option[T]]
trait Source[T]
class Base[State, Pulse[T]]
trait ReSource
class Object
trait Matchable
class Any
trait Flatten[-A, R]

Attributes

Inherited from:
FlattenApi
Graph
Supertypes
class Object
trait Matchable
class Any
object Fold

Attributes

Inherited from:
EventCompatBundle
Graph
Supertypes
class Object
trait Matchable
class Any
object Observe

observers are normale reactives that are configured by a function that converts the value of the input into an ObserveInteract

observers are normale reactives that are configured by a function that converts the value of the input into an ObserveInteract

Attributes

Inherited from:
ObserveBundle
Graph
Supertypes
class Object
trait Matchable
class Any

Attributes

Inherited from:
ObserveBundle
Graph
Supertypes
class Object
trait Matchable
class Any
trait ReadableMacro[S[_], +A] extends ReadAs[S, A] with MacroAccess[A, ReadAs[S, A]]

Attributes

Inherited from:
ReadableMacroBundle
Graph
Supertypes
trait MacroAccess[A, ReadAs[S, A]]
trait ReadAs[S, A]
trait ReSource
class Object
trait Matchable
class Any
Known subtypes
trait EventCompat[T]
trait Event[T]
class EventImpl[T]
class Evt[T]
trait SignalCompat[T]
trait Signal[T]
class SignalImpl[T]
class Var[A]
class Reactor[T]
trait Signal[+T] extends Disconnectable with SignalCompat[T]

Time changing value derived from the dependencies.

Time changing value derived from the dependencies.

Attributes

T

Type stored by the signal

Inherited from:
SignalBundle
Graph
Supertypes
trait SignalCompat[T]
trait MacroAccess[T, ReadAs[State, T]]
trait ReadAs[State, T]
trait ReSource
class Object
trait Matchable
class Any
Known subtypes
class SignalImpl[T]
class Var[A]
trait SignalCompat[+T] extends ReadableMacro[State, T]

Attributes

Inherited from:
SignalCompatBundle
Graph
Supertypes
trait MacroAccess[T, ReadAs[State, T]]
trait ReadAs[State, T]
trait ReSource
class Object
trait Matchable
class Any
Known subtypes
trait Signal[T]
class SignalImpl[T]
class Var[A]
class SignalImpl[T](initial: State[Pulse[T]], expr: (DynamicTicket, () => T) => T, name: ReInfo, isDynamicWithStaticDeps: Option[Set[of[State]]]) extends DerivedImpl[T] with Signal[T]

Attributes

isDynamicWithStaticDeps

None means static dependencies only, Some means dynamic with the given static ones for optimization

Inherited from:
DefaultImplementations
Graph
Supertypes
trait Signal[T]
trait SignalCompat[T]
trait MacroAccess[T, ReadAs[State, T]]
trait ReadAs[State, T]
class DerivedImpl[T]
trait Derived
class Base[State, Pulse[T]]
trait ReSource
class Object
trait Matchable
class Any
object Signals

Functions to construct signals, you probably want to use signal expressions in rescala.interface.RescalaInterface.Signal for a nicer API.

Functions to construct signals, you probably want to use signal expressions in rescala.interface.RescalaInterface.Signal for a nicer API.

Attributes

Inherited from:
SignalBundle
Graph
Supertypes
class Object
trait Matchable
class Any
trait Source[T] extends ReSource

Attributes

Inherited from:
Sources
Graph
Supertypes
trait ReSource
class Object
trait Matchable
class Any
Known subtypes
class Evt[T]
class Var[A]
class UserDefinedFunction[+T, Dep, Cap](val staticDependencies: Set[Dep], val expression: Cap => T, val isStatic: Boolean)

Attributes

Inherited from:
SignalCompatBundle
Graph
Supertypes
class Object
trait Matchable
class Any
class Var[A] extends Base[State, Pulse[A]] with Source[A] with Signal[A]

Source signals with imperatively updates.

Source signals with imperatively updates.

Attributes

A

Type stored by the signal

S

Struct type used for the propagation of the signal

Inherited from:
Sources
Graph
Supertypes
trait Signal[A]
trait SignalCompat[A]
trait MacroAccess[A, ReadAs[State, A]]
trait ReadAs[State, A]
trait Source[A]
class Base[State, Pulse[A]]
trait ReSource
class Object
trait Matchable
class Any

Inherited types

Attributes

Inherited from:
Operators

Attributes

Inherited from:
Operators
type ReSource = of[State]

Attributes

Inherited from:
Operators

Attributes

Inherited from:
Operators
type State[_]

Attributes

Inherited from:
Operators

Attributes

Inherited from:
Operators

Value members

Concrete methods

override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns:

a string representation of the object.

Definition Classes
Any

Inherited methods

inline def current[S](using fs: FoldState[S]): S

Attributes

Inherited from:
EventCompatBundle
def firstFiringEvent[B, T <: (IterableOps), Evnt <: ([A1] =>> ReadAs[State, Option[A1]])](implicit ticket: CreationTicket): Flatten[Signal[T[Evnt[B]]], Event[B]]

Flatten a Signal[Traversable[Event[B]]] into a Event[B]. The new Event fires the value of any inner firing Event. If multiple inner Events fire, the first one in iteration order is selected.

Flatten a Signal[Traversable[Event[B]]] into a Event[B]. The new Event fires the value of any inner firing Event. If multiple inner Events fire, the first one in iteration order is selected.

Attributes

Inherited from:
FlattenCollectionCompat
def traversableOfAllOccuringEventValues[B, T <: (IterableOps), Evnt <: (Event)](implicit ticket: CreationTicket): Flatten[Signal[T[Evnt[B]]], Event[T[Option[B]]]]

Flatten a Signal[Traversable[Event[B]]] into a Event[Traversable[Option[B]]] where the new Event fires whenever any of the inner events fire

Flatten a Signal[Traversable[Event[B]]] into a Event[Traversable[Option[B]]] where the new Event fires whenever any of the inner events fire

Attributes

Inherited from:
FlattenCollectionCompat

Extensions

Inherited extensions

extension [T](e: Event[T])
inline def act[S](inline f: FoldState[S] ?=> T => S): Branch[S]

Attributes

Inherited from:
EventCompatBundle

Implicits

Implicits

implicit def OnEv[T](e: Event[T]): OnEv[T]
implicit def OnEvs[T](e: => Seq[Event[T]]): OnEvs[T]

Inherited implicits

implicit def flattenImplicitForarraySignals[B : ClassTag, Sig <: (Signal)](implicit evidence$1: ClassTag[B], ticket: CreationTicket): Flatten[Signal[Array[Sig[B]]], Signal[Array[B]]]

Flatten a Signal[Array[Signal[B]]] into a Signal[Array[B]] where the new Signal updates whenever any of the inner or the outer signal updates

Flatten a Signal[Array[Signal[B]]] into a Signal[Array[B]] where the new Signal updates whenever any of the inner or the outer signal updates

Attributes

Inherited from:
FlattenApi
implicit def flattenImplicitForevent[A, B, Evnt <: (Event)](implicit ticket: CreationTicket): Flatten[Signal[Evnt[B]], Event[B]]

Flatten a Signal[Event[B]]] into a Event[B] where the new Event fires whenever the current inner event fires

Flatten a Signal[Event[B]]] into a Event[B] where the new Event fires whenever the current inner event fires

Attributes

Inherited from:
FlattenApi
implicit def flattenImplicitForoption[A, B](implicit ticket: CreationTicket): Flatten[Event[Option[B]], Event[B]]

Flatten a Event[Option[B]] into a Event[B] that fires whenever the inner option is defined.

Flatten a Event[Option[B]] into a Event[B] that fires whenever the inner option is defined.

Attributes

Inherited from:
FlattenApi
implicit def flattenImplicitForoptionSignal[B, Sig <: (Signal)](implicit ticket: CreationTicket): Flatten[Signal[Option[Sig[B]]], Signal[Option[B]]]

Flatten a Signal[Option[Signal[B]]] into a Signal[Option[B]] where the new Signal updates whenever any of the inner or the outer signal updates

Flatten a Signal[Option[Signal[B]]] into a Signal[Option[B]] where the new Signal updates whenever any of the inner or the outer signal updates

Attributes

Inherited from:
FlattenApi
implicit def flattenImplicitForsignal[B](implicit ticket: CreationTicket): Flatten[Signal[Signal[B]], Signal[B]]

Flatten a Signal[Signal[B]] into a Signal[B] that changes whenever the outer or inner signal changes.

Flatten a Signal[Signal[B]] into a Signal[B] that changes whenever the outer or inner signal changes.

Attributes

Inherited from:
FlattenApi
implicit def flattenImplicitFortraversableSignals[B, T <: (IterableOps), Sig <: (Signal)](implicit ticket: CreationTicket): Flatten[Signal[T[Sig[B]]], Signal[T[B]]]

Flatten a Signal[Traversable[Signal[B]]] into a Signal[Traversable[B]] where the new Signal updates whenever any of the inner or the outer signal updates

Flatten a Signal[Traversable[Signal[B]]] into a Signal[Traversable[B]] where the new Signal updates whenever any of the inner or the outer signal updates

Attributes

Inherited from:
FlattenCollectionCompat