Channel is a stateless Reactive implementation exposing a public method to fire values.
Channel is a stateless Reactive implementation exposing a public method to fire values.
the type of value this Reactive receives
Dep allows creation of a dependent Var
on another Var
allowing conversion between the two.
Dep allows creation of a dependent Var
on another Var
allowing conversion between the two. This can be useful for
different representations of the same value. For example, in a graphical environment left
, center
, and right
are all different representations of the value (horizontal position). Maintaining three distinct values while
keeping them in-sync is painful. With Dep
you can simply define one Var
and two Dep
values like:
val left: Var[Double] = Var(0.0)
val width: Var[Double] = Var(0.0)
val center: Dep[Double, Double] = Dep(left)(_ + (width / 2.0), _ - (width / 2.0))
val right: Dep[Double, Double] = Dep(left)(_ + width, _ - width)
Now, modification to left
, center
, or right
will maintain the appropriate value for each without any additional
boilerplate.
the type of value this Reactive receives
the type that this Dep receives
Syntactic sugar for mutating collections in a Var
Reactive is the core trait for Reactify.
Reactive is the core trait for Reactify. The basic premise is that a Reactive represents an instance that can attach
Reactions and fire instances of T
that are received by those Reactions.
the type of value this Reactive receives
State is an internal class to represent the assigned state of a Val
, Var
, or Dep
Trigger is a convenience class wrapping Channel[Unit]
specifically for scenarios where the value doesn't matter,
just the reactions themselves.
Val represents a final variable that cannot be set apart from its instantiation.
Val represents a final variable that cannot be set apart from its instantiation. However, unlike a Scala val
, a
Val
may still fire changes if its value is derived from Var
s that make it up. A Val
is a stateful Reactive
.
the type of value this Reactive receives
Var represents the combination of Val
and Channel
into a stateful and mutable underlying value.
Var represents the combination of Val
and Channel
into a stateful and mutable underlying value.
the type of value this Reactive receives
Convenience values for Priorities
StateCounter provides infrastructure to glean the references to State
s within a functional block of code.
StateCounter provides infrastructure to glean the references to State
s within a functional block of code. This is
primarily for internal use, but can be used externally to get additional information regarding references.