Evt

reactives.operator.Evt
See theEvt companion object
class Evt[T] extends Base[Pulse[T]], Source[T], Event[T]

Source events with imperative occurrences

Type parameters

S

Struct type used for the propagation of the event

T

Type returned when the event fires

Value parameters

initialState

of by the event

Attributes

Companion
object
Graph
Supertypes
trait Event[T]
trait MacroAccess[Option[T]]
trait ReadAs[Option[T]]
trait Source[T]
class Base[Pulse[T]]
trait ReSource
class Object
trait Matchable
class Any
Show all

Members list

Grouped members

internal

override def read(v: Value): Option[T]

Interprets the pulse of the event by converting to an option

Interprets the pulse of the event by converting to an option

Attributes

Definition Classes
Inherited from:
Event

conversion

final def count()(using ticket: CreationTicket[State]): Signal[Int]

Counts the occurrences of the event. The argument of the event is discarded. Always starts from 0 when the count is created (no matter how often the event has activated in the past).

Counts the occurrences of the event. The argument of the event is discarded. Always starts from 0 when the count is created (no matter how often the event has activated in the past).

Attributes

Inherited from:
Event
final def hold[A >: T]()(using ticket: CreationTicket[State]): Signal[A]

returns a signal holding the latest value of the event.

returns a signal holding the latest value of the event.

Attributes

Inherited from:
Event
final def hold[A >: T](init: A)(using ticket: CreationTicket[State]): Signal[A]

returns a signal holding the latest value of the event.

returns a signal holding the latest value of the event.

Value parameters

init

initial value of the returned signal

Attributes

Inherited from:
Event
final def holdOption[A >: T]()(using ticket: CreationTicket[State]): Signal[Option[A]]

Holds the latest value of an event as an Option, None before the first event occured

Holds the latest value of an event as an Option, None before the first event occured

Attributes

Inherited from:
Event
final def iterate[A](init: A)(f: A => A)(using ticket: CreationTicket[State]): Signal[A]

Applies a function on the current value of the signal every time the event occurs, starting with the init value before the first event occurrence

Applies a function on the current value of the signal every time the event occurs, starting with the init value before the first event occurrence

Attributes

Inherited from:
Event
final def list[A >: T]()(using ticket: CreationTicket[State]): Signal[List[A]]

collects events resulting in a variable holding a list of all values.

collects events resulting in a variable holding a list of all values.

Attributes

Inherited from:
Event
final def list[A >: T](n: Int)(using ticket: CreationTicket[State]): Signal[LinearSeq[A]]

Returns a signal which holds the last n events in a list. At the beginning the list increases in size up to when n values are available

Returns a signal which holds the last n events in a list. At the beginning the list increases in size up to when n values are available

Attributes

Inherited from:
Event
final def toggle[A](a: Signal[A], b: Signal[A])(using ticket: CreationTicket[State]): Signal[A]

Switch back and forth between two signals on occurrence of event e

Switch back and forth between two signals on occurrence of event e

Attributes

Inherited from:
Event

conversion

final inline def fold[A](init: A)(inline op: (A, T) => A)(using ticket: CreationTicket[State]): Signal[A]

Folds events with a given operation to create a Signal.

Folds events with a given operation to create a Signal.

Attributes

Inherited from:
Event

accessor

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

Add an observer.

Add an observer.

Attributes

Returns

the resulting reactives.structure.Observe can be used to remove the observer.

Inherited from:
Event
final def value: Option[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

operator

final inline def &&(inline expression: T => Boolean)(using ticket: CreationTicket[State]): Event[T]

Filters the event, only propagating the value when the filter is true.

Filters the event, only propagating the value when the filter is true.

Attributes

Inherited from:
Event
final inline def collect[U](inline expression: PartialFunction[T, U])(using CreationTicket[State]): Event[U]

Collects the results from a partial function

Collects the results from a partial function

Attributes

Inherited from:
Event
final def except(exception: Event[Any])(using ticket: CreationTicket[State]): Event[T]

Propagates the event only when the other event exception does not fire.

Propagates the event only when the other event exception does not fire.

Attributes

Inherited from:
Event
final inline def filter(inline expression: T => Boolean)(using ticket: CreationTicket[State]): Event[T]

Filters the event, only propagating the value when the filter is true.

Filters the event, only propagating the value when the filter is true.

Attributes

Inherited from:
Event
final def flatten[R](using flatten: Flatten[Event[T], R]): R

Flattens the inner value.

Flattens the inner value.

Attributes

Inherited from:
Event
final inline def map[B](inline expression: T => B)(using ticket: CreationTicket[State]): Event[B]

Transform the event.

Transform the event.

Attributes

Inherited from:
Event
final inline def snap[B, T1 >: T](inline expression: B)(using CreationTicket[State])(using T1 =:= Unit): Event[B]

Like map, but allows to ignore the parameter if its type is Unit. Useful for snapshotting some signals when an event triggers

Like map, but allows to ignore the parameter if its type is Unit. Useful for snapshotting some signals when an event triggers

Attributes

Inherited from:
Event
final def ||[U >: T](other: Event[U])(using ticket: CreationTicket[State]): Event[U]

Events disjunction. Propagates the values if any of the events fires. Only propagates the left event if both fire.

Events disjunction. Propagates the values if any of the events fires. Only propagates the left event if both fire.

Attributes

Inherited from:
Event

Type members

Types

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

Inherited types

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

Inherited from:
Event

Value members

Concrete methods

def admitPulse(pulse: Pulse[T])(using ticket: AdmissionTicket[State]): Unit
override def disconnect(): Unit

Attributes

Definition Classes
def fire()(using PlanTransactionScope[State])(using Unit =:= T): Unit
def fire(value: T)(using planTransactionScope: PlanTransactionScope[State]): Unit

Deprecated methods

def apply(value: T)(using PlanTransactionScope[State]): Unit

Trigger the event

Trigger the event

Attributes

Deprecated
[Since version 0.21.0] use .fire instead of apply

Inherited methods

final def admit(value: T)(using ticket: AdmissionTicket[State]): Unit

Attributes

Inherited from:
Source
final inline def branch[S](inline f: FoldState[S] ?=> T => S): Branch[S]

This creates a branch that can be combined into a Fold

This creates a branch that can be combined into a Fold

Attributes

Inherited from:
Event
final def recover[R >: T](onFailure: PartialFunction[Exception, Option[R]])(using ticket: CreationTicket[State]): Event[R]

Uses a partial function onFailure to recover an error carried by the event into a value when returning Some(value), or filters the error when returning None

Uses a partial function onFailure to recover an error carried by the event into a value when returning Some(value), or filters the error when returning None

Attributes

Inherited from:
Event
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
Base -> Any
Inherited from:
Base

Inherited fields

override val info: ReInfo

Developer friendly information about the resource.

Developer friendly information about the resource.

Attributes

Inherited from:
Base

Extensions

Extensions

extension (v: Pulse[T])
override def access: Pulse[T]

Attributes

Definition Classes