trait Observable[T] extends AnyRef
Observable, as the name suggests, observes values being fired against it. This is the core functionality of Reactify and provides the infrastructure used by Channel, Val, Var, Prop, and Dep.
- T
the type of value this Observable will receive
- Alphabetic
- By Inheritance
- Observable
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
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]
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
attach(f: (T) ⇒ Unit, priority: Double = Observer.Priority.Normal): Observer[T]
Attaches a function to observe values fired against this Observable.
Attaches a function to observe values fired against this Observable.
- f
function observer
- returns
the supplied function. This reference is useful for detaching the function later
-
def
changes(observer: ChangeObserver[T]): Observer[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.- observer
the ChangeObserver
- returns
the observer attached. This can be passed to
detach
to remove this observer
-
def
clearObservers(): Unit
Clears all attached observers from this Observable.
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
- def collect[R](f: PartialFunction[T, R]): Observable[R]
-
def
detach(observer: Observer[T]): Unit
Detaches a function from observing this Observable.
Detaches a function from observing this Observable.
- observer
function observer that was previously attached
-
def
dispose(): Unit
Cleans up all cross references in preparation for releasing for GC.
-
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]
-
final
def
fireRecursive(value: T, type: InvocationType, invocation: Invocation, observers: List[Observer[T]]): Unit
- Attributes
- protected
-
def
future(condition: (T) ⇒ Boolean = (_: 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 observer will be invoked. Defaults to always return true.
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
map[R](f: (T) ⇒ R): Observable[R]
Maps the Observable to another type.
Maps the Observable to another type.
- R
the type of the new Observable
- f
function to handle the mapping from T to R
- returns
Observable[R]
-
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(observer: Observer[T]): Observer[T]
Direct attachment of a observer.
Direct attachment of a observer.
- observer
the observer to attach
- returns
the same observer supplied
-
def
observers: List[Observer[T]]
List of all the observers currently observing changes to this Observable.
-
def
on(f: ⇒ Unit, priority: Double = Observer.Priority.Normal): Observer[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
observer
-
def
once(f: (T) ⇒ Unit, condition: (T) ⇒ Boolean = (_: T) => true, priority: Double = Observer.Priority.Normal): Observer[T]
Invokes the observer only one time and then detaches itself.
Invokes the observer only one time and then detaches itself. If supplied, the condition filters the scenarios in which the observer will be invoked.
- f
the function observer
- condition
the condition under which the observer will be invoked. Defaults to always return true.
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
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( ... )