reactify
package reactify
- Alphabetic
- By Inheritance
- reactify
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
trait
Channel[T] extends Reactive[T]
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.
- T
the type of value this Reactive receives
-
trait
Dep[T, R] extends Var[T]
Dep allows creation of a dependent
Var
on anotherVar
allowing conversion between the two.Dep allows creation of a dependent
Var
on anotherVar
allowing conversion between the two. This can be useful for different representations of the same value. For example, in a graphical environmentleft
,center
, andright
are all different representations of the value (horizontal position). Maintaining three distinct values while keeping them in-sync is painful. WithDep
you can simply define oneVar
and twoDep
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
, orright
will maintain the appropriate value for each without any additional boilerplate.- T
the type of value this Reactive receives
- R
the type that this Dep receives
-
implicit
class
ListVar[T] extends AnyRef
Syntactic sugar for mutating collections in a
Var
-
trait
Reactive[T] extends AnyRef
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.- T
the type of value this Reactive receives
-
case class
State[T](owner: Reactive[T], index: Long, function: () ⇒ T) extends Reaction[Any] with Product with Serializable
State is an internal class to represent the assigned state of a
Val
,Var
, orDep
- class StateCounter extends AnyRef
-
trait
Trigger extends Channel[Unit]
Trigger is a convenience class wrapping
Channel[Unit]
specifically for scenarios where the value doesn't matter, just the reactions themselves. -
trait
Val[T] extends Reactive[T]
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
, aVal
may still fire changes if its value is derived fromVar
s that make it up. AVal
is a statefulReactive
.- T
the type of value this Reactive receives
-
trait
Var[T] extends Val[T] with Channel[T]
Var represents the combination of
Val
andChannel
into a stateful and mutable underlying value.Var represents the combination of
Val
andChannel
into a stateful and mutable underlying value.- T
the type of value this Reactive receives
- implicit class VectorVar[T] extends AnyRef
Value Members
- implicit def val2Value[T](v: Val[T]): T
- object Channel
- object Dep
-
object
Priority
Convenience values for Priorities
- object Reactive
-
object
StateCounter
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. - object Trigger
- object Val
- object Var