Trait/Object

reactify

Dep

Related Docs: object Dep | package reactify

Permalink

trait Dep[T, R] extends Var[T]

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.

T

the type of value this Reactive receives

R

the type that this Dep receives

Linear Supertypes
Var[T], Channel[T], Val[T], Reactive[T], AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Dep
  2. Var
  3. Channel
  4. Val
  5. Reactive
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def mode: Mode

    Permalink

    Operating mode of this Var.

    Operating mode of this Var. Defaults to Normal

    Definition Classes
    Var
  2. abstract def owner: Var[R]

    Permalink
  3. abstract def r2T(r: R): T

    Permalink
  4. abstract def set(value: ⇒ T): Unit

    Permalink

    Public method to fire a value against the Reactions attached to this Channel

    Public method to fire a value against the Reactions attached to this Channel

    value

    the function value

    Definition Classes
    Channel
  5. abstract def state: State[T]

    Permalink

    The current State representation

    The current State representation

    Definition Classes
    Val
  6. abstract def t2R(t: T): R

    Permalink

Concrete Value Members

  1. def !(future: Future[T]): Future[Unit]

    Permalink

    Convenience functionality to assign the result of a future (upon completion) to this Channel

    Convenience functionality to assign the result of a future (upon completion) to this Channel

    Definition Classes
    Channel
  2. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  4. def &(that: Var[T]): Var[T]

    Permalink

    Group multiple Vars together

    Group multiple Vars together

    Definition Classes
    Var
  5. def &(that: Channel[T]): Channel[T]

    Permalink

    Group multiple channels together

    Group multiple channels together

    Definition Classes
    Channel
  6. def &(that: Val[T]): Val[T]

    Permalink

    Group multiple Vals together

    Group multiple Vals together

    Definition Classes
    Val
  7. def :=(value: ⇒ T): Unit

    Permalink

    Convenience method to fire a value

    Convenience method to fire a value

    value

    the function value

    Definition Classes
    Channel
    See also

    #set

  8. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  9. def @=(value: T): Unit

    Permalink

    Convenience method for static (non-functional) invocation.

    Convenience method for static (non-functional) invocation.

    value

    the value

    Definition Classes
    Channel
    See also

    #set

  10. def and(that: Var[T]): Var[T]

    Permalink

    Group multiple Vars together

    Group multiple Vars together

    Definition Classes
    Var
  11. def and(that: Channel[T]): Channel[T]

    Permalink

    Group multiple channels together

    Group multiple channels together

    Definition Classes
    Channel
  12. def and(that: Val[T]): Val[T]

    Permalink

    Group multiple Vals together

    Group multiple Vals together

    Definition Classes
    Val
  13. def apply(): T

    Permalink

    Convenience wrapper around get

    Convenience wrapper around get

    Definition Classes
    Val
  14. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  15. def attach(f: (T) ⇒ Unit, priority: Double = Priority.Normal): Reaction[T]

    Permalink

    Convenience method to create a Reaction to attach to this Reactive

    Convenience method to create a Reaction to attach to this Reactive

    f

    the function reaction

    priority

    the priority in comparison to other reactions (Defaults to Priority.Normal)

    returns

    created Reaction[T]

    Definition Classes
    Reactive
  16. def attachAndFire(f: (T) ⇒ Unit, priority: Double = Priority.Normal): Reaction[T]

    Permalink

    Convenience functionality to attach a Reaction and immediately fire the current state on the Reaction.

    Convenience functionality to attach a Reaction and immediately fire the current state on the Reaction.

    f

    the function reaction

    priority

    the priority in comparison to other reactions (Defaults to Priority.Normal)

    returns

    Reaction[T]

    Definition Classes
    Val
  17. def bind[V](that: Var[V], setNow: BindSet = BindSet.LeftToRight)(implicit t2v: (T) ⇒ V, v2t: (V) ⇒ T): Binding[T, V]

    Permalink

    Convenience method to create a binding between two Vars

    Convenience method to create a binding between two Vars

    V

    the type of the second Var

    that

    the second Var to bind between

    setNow

    the BindSet value (Defaults to LeftToRight)

    t2v

    implicit function conversion from T to V

    v2t

    implicit function conversion from V to T

    returns

    Binding[T, V]

    Definition Classes
    Var
  18. def changes(f: (T, T) ⇒ Unit, priority: Double = Priority.Normal): Reaction[T]

    Permalink

    Convenience method to create a Reaction to monitor changes to this Reactive

    Convenience method to create a Reaction to monitor changes to this Reactive

    f

    the function reaction to receive changes

    priority

    the priority in comparison to other reactions (Defaults to Priority.Normal)

    returns

    created Reaction[T]

    Definition Classes
    Reactive
  19. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  20. def collect[R](f: PartialFunction[T, R]): Channel[R]

    Permalink

    Functional collection of this Channel into another Channel.

    Functional collection of this Channel into another Channel. All values received by this Channel will be collected and forwarded to the new Channel if they are collected by the conversion function.

    R

    the type of the Channel

    f

    conversion partial function

    returns

    Channel[R]

    Definition Classes
    Channel
  21. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  22. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  23. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  24. def fire(value: T, previous: Option[T], reactions: List[Reaction[T]] = this.reactions()): ReactionStatus

    Permalink

    Fires the value to the Reactions

    Fires the value to the Reactions

    Attributes
    protected
    Definition Classes
    Reactive
  25. def future(condition: (T) ⇒ Boolean = _ => true): Future[T]

    Permalink

    Convenience method to create a Future[T] that will complete upon the next reaction that meets to supplied condition.

    Convenience method to create a Future[T] that will complete upon the next reaction that meets to supplied condition.

    condition

    optional condition that must be true for this to fire (Defaults to accept anything)

    returns

    Future[T]

    Definition Classes
    Reactive
  26. def get: T

    Permalink

    Gets the current value from the current State

    Gets the current value from the current State

    Definition Classes
    Val
  27. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  28. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  29. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  30. def map[R](f: (T) ⇒ R): Var[R]

    Permalink

    Functional mapping of this Var into another Var.

    Functional mapping of this Var into another Var.

    R

    the type of the new Var

    f

    conversion function

    returns

    Var[R]

    Definition Classes
    VarChannelVal
  31. def name: Option[String]

    Permalink

    An optional name associated.

    An optional name associated. This is primarily used for distinguishing between instances as well as logging.

    Definition Classes
    Reactive
  32. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  33. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  34. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  35. def on(f: ⇒ Unit, priority: Double = Priority.Normal): Reaction[T]

    Permalink

    Convenience method to create a Reaction to monitor changes to this Reactive when you don't care about the actual value.

    Convenience method to create a Reaction to monitor changes to this Reactive when you don't care about the actual value.

    f

    the function reaction to invoke in reaction to a value received

    priority

    the priority in comparison to other reactions (Defaults to Priority.Normal)

    returns

    created Reaction[T]

    Definition Classes
    Reactive
  36. def once(f: (T) ⇒ Unit, condition: (T) ⇒ Boolean = _ => true, priority: Double = Priority.Normal): Reaction[T]

    Permalink

    Convenience method to create a Reaction to monitor a single reaction based on an optional condition.

    Convenience method to create a Reaction to monitor a single reaction based on an optional condition.

    f

    the function reaction

    condition

    optional condition that must be true for this to fire (Defaults to accept anything)

    priority

    the priority in comparison to other reactions (Defaults to Priority.Normal)

    returns

    created Reaction[T]

    Definition Classes
    Reactive
  37. lazy val reactions: Reactions[T]

    Permalink

    Reactions currently associated with this Reactive

    Reactions currently associated with this Reactive

    Definition Classes
    Reactive
  38. def static(value: T): Unit

    Permalink

    Statically sets a value without monitoring effects

    Statically sets a value without monitoring effects

    value

    the value to assign

    Definition Classes
    Var
  39. def status: Option[ReactionStatus]

    Permalink

    If the current thread is reacting to a value currently, status represents the status of the reaction.

    If the current thread is reacting to a value currently, status represents the status of the reaction. This can be set to ReactionStatus.Stop in order to stop propagation. This can also be achieved via stopPropagation().

    Definition Classes
    Reactive
  40. def status_=(status: ReactionStatus): Unit

    Permalink
    Definition Classes
    Reactive
  41. def stopPropagation(): Unit

    Permalink

    Shortcut functionality to call status = ReactionStatus.Stop

    Shortcut functionality to call status = ReactionStatus.Stop

    Definition Classes
    Reactive
  42. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  43. def toString(): String

    Permalink
    Definition Classes
    VarChannelVal → AnyRef → Any
  44. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  45. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  46. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Var[T]

Inherited from Channel[T]

Inherited from Val[T]

Inherited from Reactive[T]

Inherited from AnyRef

Inherited from Any

Ungrouped