Static methods
staticinlinecreate<T>(f:(fire:T ‑> Void) ‑> CallbackLink):Signal<T>
staticfilter(this:SignalObject<T>, f:T ‑> Bool, ?gather:Gather):Signal<T>
Creates a new signal whose values will only be emitted when the filter function evalutes to true
staticflatMap<A>(this:SignalObject<T>, f:T ‑> Future<A>, ?gather:Gather):Signal<A>
Creates a new signal by applying a transform function to the result.
* Different from map
, the transform function of flatMap
returns a Future
staticgather(this:SignalObject<T>):Signal<T>
Creates a new signal which stores the result internally.
Useful for tranformed signals, such as product of map
and flatMap
,
so that the transformation function will not be invoked for every callback
staticgenerate<T>(generator:T ‑> Void ‑> Void, ?init:OwnedDisposable ‑> Void):Signal<T>
An alternative to new Signal()
if you have no CallbackLink
to return.
Other than that, it behaves exactly the same.
staticjoin(this:SignalObject<T>, that:Signal<T>, ?gather:Gather):Signal<T>
Creates a new signal by joining this
and that
,
* the new signal will be triggered whenever either of the two triggers
staticmap<A>(this:SignalObject<T>, f:T ‑> A, ?gather:Gather):Signal<A>
Creates a new signal by applying a transform function to the result.
* Different from flatMap
, the transform function of map
returns a sync value
staticinlinenext(this:SignalObject<T>, ?condition:T ‑> Bool):Future<T>
staticnextTime(this:SignalObject<T>, ?condition:T ‑> Bool):Future<T>
Gets the next emitted value as a Future
staticofClassical<A>(add:A ‑> Void ‑> Void, remove:A ‑> Void ‑> Void, ?gather:Gather):Signal<A>
Creates a Signal
from classic signals that has the semantics of addListener
and removeListener
* Example: var signal = Signal.ofClassical(emitter.addListener.bind(eventType), emitter.removeListener.bind(eventType));