Class/Object

reactify

Dep

Related Docs: object Dep | package reactify

Permalink

class Dep[T, R] extends Reactive[T] with Stateful[T] with Mutable[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
Mutable[T], Stateful[T], Reactive[T], AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Dep
  2. Mutable
  3. Stateful
  4. Reactive
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Dep(owner: Var[R], t2R: (T) ⇒ R, r2T: (R) ⇒ T)

    Permalink

    Attributes
    protected

Value Members

  1. def !(future: Future[T])(implicit ec: ExecutionContext): 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
    Mutable
  2. final def !=(arg0: Any): Boolean

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

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

    Permalink

    Group multiple Statefuls together

    Group multiple Statefuls together

    Definition Classes
    Stateful
  5. def :=(f: ⇒ T): Unit

    Permalink

    Convenience alternative to "set"

    Convenience alternative to "set"

    Definition Classes
    Mutable
  6. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  7. def @=(f: T): Unit

    Permalink

    Convenience alternative to "static"

    Convenience alternative to "static"

    Definition Classes
    Mutable
  8. def and(that: Stateful[T]): Stateful[T]

    Permalink

    Group multiple Statefuls together

    Group multiple Statefuls together

    Definition Classes
    Stateful
  9. def apply(): T

    Permalink

    Convenience wrapper around get

    Convenience wrapper around get

    Definition Classes
    Stateful
  10. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  11. 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
  12. 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
    Stateful
  13. 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
  14. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  15. final def eq(arg0: AnyRef): Boolean

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

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

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  18. 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
  19. 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
  20. def get: T

    Permalink

    Gets the current value

    Gets the current value

    Definition Classes
    DepStateful
  21. final def getClass(): Class[_]

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

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

    Permalink
    Definition Classes
    Any
  24. final def ne(arg0: AnyRef): Boolean

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

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

    Permalink
    Definition Classes
    AnyRef
  27. 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
  28. 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
  29. val owner: Var[R]

    Permalink
  30. lazy val reactions: Reactions[T]

    Permalink

    Reactions currently associated with this Reactive

    Reactions currently associated with this Reactive

    Definition Classes
    Reactive
  31. def set(f: ⇒ T): Unit

    Permalink

    Sets the function evaluation representing the new value for this mutable entity

    Sets the function evaluation representing the new value for this mutable entity

    Definition Classes
    DepMutable
  32. def static(f: T): Unit

    Permalink

    Sets a static value representing the new value for this mutable entity

    Sets a static value representing the new value for this mutable entity

    Definition Classes
    Mutable
  33. 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
  34. def status_=(status: ReactionStatus): Unit

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

    Permalink

    Shortcut functionality to call status = ReactionStatus.Stop

    Shortcut functionality to call status = ReactionStatus.Stop

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  38. def update(f: ⇒ T): Unit

    Permalink

    Convenience alternative to "set"

    Convenience alternative to "set"

    Definition Classes
    Mutable
  39. final def wait(): Unit

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

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

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

Inherited from Mutable[T]

Inherited from Stateful[T]

Inherited from Reactive[T]

Inherited from AnyRef

Inherited from Any

Ungrouped