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
- Alphabetic
- By Inheritance
- Val
- AbstractState
- State
- Observable
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new Val(function: () ⇒ T, distinct: Boolean = true, cache: Boolean = true, recursion: RecursionMode = RecursionMode.RetainPreviousValue, transactional: Boolean = true, onUpdate: Boolean = false)
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
and(that: Observable[T]): Observable[T]
- Definition Classes
- Observable
-
def
apply(): T
- Definition Classes
- State
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
attach(f: (T) ⇒ Unit, priority: Double = Listener.Priority.Normal): Listener[T]
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
-
def
attachAndFire(f: (T) ⇒ Unit): Listener[T]
- Definition Classes
- State
- def changed(value: T, previous: T, type: InvocationType): Unit
-
def
changes(listener: ChangeListener[T]): Listener[T]
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
detachto remove this listener
- Definition Classes
- State → Observable
-
def
clear(): Unit
Clears all attached observers from this Observable.
Clears all attached observers from this Observable.
- Definition Classes
- Observable
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
def
detach(listener: Listener[T]): Unit
Detaches a function from listening to this Observable.
Detaches a function from listening to this Observable.
- listener
function listener that was previously attached
- Definition Classes
- Observable
-
def
dispose(): Unit
Cleans up all cross references in preparation for releasing for GC.
Cleans up all cross references in preparation for releasing for GC.
- Definition Classes
- Observable
-
val
distinct: Boolean
- Definition Classes
- AbstractState → State
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
fire(value: T, type: InvocationType): Unit
- Attributes
- protected[reactify]
- Definition Classes
- Observable
-
final
def
fireRecursive(value: T, type: InvocationType, invocation: Invocation, observers: List[Listener[T]]): Unit
- Attributes
- protected
- Definition Classes
- Observable
-
def
future(condition: (T) ⇒ Boolean = (t: T) => true): Future[T]
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
-
final
def
get: T
- Definition Classes
- State
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
val
manager: StateInstanceManager[T]
- Definition Classes
- AbstractState
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
def
observe(listener: Listener[T]): Listener[T]
Direct attachment of a listener.
Direct attachment of a listener.
- listener
the listener to attach
- returns
the same listener supplied
- Definition Classes
- Observable
-
def
observing: Set[Observable[_]]
- Definition Classes
- AbstractState → State
-
def
on(f: ⇒ Unit, priority: Double = Listener.Priority.Normal): Listener[T]
Works like
attach, but doesn't receive the fired value.Works like
attach, but doesn't receive the fired value.- f
function to invoke on fire
- returns
listener
- Definition Classes
- Observable
-
def
once(f: (T) ⇒ Unit, condition: (T) ⇒ Boolean = (_: T) => true, priority: Double = Listener.Priority.Normal): Listener[T]
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
-
def
set(value: ⇒ T): Unit
- Attributes
- protected
- Definition Classes
- AbstractState → State
-
def
static(value: T): Unit
- Attributes
- protected
- Definition Classes
- State
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- Val → AnyRef → Any
-
def
value(): T
- Attributes
- protected
- Definition Classes
- AbstractState → State
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )