Class/Object

reactify

Val

Related Docs: object Val | package reactify

Permalink

class Val[T] extends AbstractState[T]

Val, as the name suggests, is like a Scala val. This represents an immutable value that is set in the first place and then not modified. However, since the value set may be built from Observables, the generated value may change over time as its dependencies are modified. This class is Observable and will only fire changes if the underlying value is derived from one or more Observables.

T

the type of value retained by this State

Linear Supertypes
AbstractState[T], State[T], Observable[T], AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Val
  2. AbstractState
  3. State
  4. Observable
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Val(function: () ⇒ T, distinct: Boolean, cache: Boolean)

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

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

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. def apply(): T

    Permalink
    Definition Classes
    State
  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. def attach(f: (T) ⇒ Unit): (T) ⇒ Unit

    Permalink

    Attaches a function to listen to values fired against this Observable.

    Attaches a function to listen to values fired against this Observable.

    f

    function listener

    returns

    the supplied function. This reference is useful for detaching the function later

    Definition Classes
    Observable
  7. def attachAndFire(f: (T) ⇒ Unit): (T) ⇒ Unit

    Permalink
    Definition Classes
    State
  8. def changes(listener: ChangeListener[T]): (T) ⇒ Unit

    Permalink

    Works similarly to attach, but also references the previous value that was fired.

    Works similarly to attach, but also references the previous value that was fired. This is useful when you need to handle changes, not just new values.

    listener

    the ChangeListener

    returns

    the listener attached. This can be passed to detach to remove this listener

    Definition Classes
    StateObservable
  9. def clear(): Unit

    Permalink

    Clears all attached observers from this Observable.

    Clears all attached observers from this Observable.

    Definition Classes
    Observable
  10. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  11. def detach(f: (T) ⇒ Unit): Unit

    Permalink

    Detaches a function from listening to this Observable.

    Detaches a function from listening to this Observable.

    f

    function listener that was previously attached

    Definition Classes
    Observable
  12. def dispose(): Unit

    Permalink

    Cleans up all cross references in preparation for releasing for GC.

    Cleans up all cross references in preparation for releasing for GC.

    Definition Classes
    AbstractStateObservable
  13. final def eq(arg0: AnyRef): Boolean

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

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

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  16. def fire(value: T): Unit

    Permalink
    Attributes
    protected[reactify]
    Definition Classes
    Observable
  17. def future(condition: (T) ⇒ Boolean = (t: T) => true): Future[T]

    Permalink

    Returns a Future[T] that represents the value of the next firing of this Observable.

    Returns a Future[T] that represents the value of the next firing of this Observable.

    condition

    the condition under which the listener will be invoked. Defaults to always return true.

    Definition Classes
    Observable
  18. def get(cache: Boolean): T

    Permalink
    Definition Classes
    AbstractState
  19. def get: T

    Permalink
    Definition Classes
    AbstractStateState
  20. final def getClass(): Class[_]

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

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

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

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

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

    Permalink
    Definition Classes
    AnyRef
  26. def observing: Set[Observable[_]]

    Permalink
    Definition Classes
    AbstractStateState
  27. def once(f: (T) ⇒ Unit, condition: (T) ⇒ Boolean = (t: T) => true): Unit

    Permalink

    Invokes the listener only one time and then detaches itself.

    Invokes the listener only one time and then detaches itself. If supplied, the condition filters the scenarios in which the listener will be invoked.

    f

    the function listener

    condition

    the condition under which the listener will be invoked. Defaults to always return true.

    Definition Classes
    Observable
  28. def replace(function: () ⇒ T, newFunction: Boolean): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    AbstractState
  29. def set(value: ⇒ T): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    AbstractState
  30. def setStatic(value: T): Unit

    Permalink

    Convenience method to pre-evaluate the value instead of as an anonymous function.

    Convenience method to pre-evaluate the value instead of as an anonymous function.

    value

    the value to be set

    Attributes
    protected
    Definition Classes
    AbstractState
  31. final def synchronized[T0](arg0: ⇒ T0): T0

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

    Permalink
    Definition Classes
    Val → AnyRef → Any
  33. def value: T

    Permalink
    Definition Classes
    State
  34. final def wait(): Unit

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

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

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

Inherited from AbstractState[T]

Inherited from State[T]

Inherited from Observable[T]

Inherited from AnyRef

Inherited from Any

Ungrouped