Convenience method to send a value to set
similarly to an assignment operator.
Convenience method to send a value to set
similarly to an assignment operator.
the value to apply
Attaches a function to listen to values fired against this Observable.
Attaches a function to listen to values fired against this Observable.
function listener
the supplied function. This reference is useful for detaching the function later
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.
the ChangeListener
the listener attached. This can be passed to detach
to remove this listener
Clears all attached observers from this Observable.
Clears all attached observers from this Observable.
Detaches a function from listening to this Observable.
Detaches a function from listening to this Observable.
function listener that was previously attached
Cleans up all cross references in preparation for releasing for GC.
Cleans up all cross references in preparation for releasing for GC.
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.
the condition under which the listener will be invoked. Defaults to always return true.
Maps the Observable to another type.
Maps the Observable to another type.
the type of the new Observable
function to handle the mapping from T to R
Observable[R]
Direct attachment of a listener.
Direct attachment of a listener.
the listener to attach
the same listener supplied
Works like attach
, but doesn't receive the fired value.
Works like attach
, but doesn't receive the fired value.
function to invoke on fire
listener
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.
the function listener
the condition under which the listener will be invoked. Defaults to always return true.
Fires the value to all attached listeners.
Dep is very much like a
Val
, but is also aChannel
. The basic purpose is to represent a value dependent upon another variable. An example of this might be if you are representing a positionleft
and you also wanted to representright
as well (which would beleft
+width
). These two variables are dependent upon each other and don't fit well asVar
s. An example usage might be:val left: Var[Double] = Var(0.0) val width: Var[Double] = Var(0.0) val right: Dep[Double, Double] = Dep(left, width)
If an instance is
submissive
it removesadjustment
from being part of the mutation dependency. For example: in the above scenario if you setwidth
to 100.0 andright
to 125.0 thenleft
will be 25.0. Now, what should happen if you changewidth
to 50.0? Shouldleft
change to 75.0 (submissive = false
) or shouldright
change to 75.0 (submissive = true
)?