-
Notifications
You must be signed in to change notification settings - Fork 8
last
richardszalay edited this page Sep 14, 2010
·
9 revisions
Emits the last value from a source sequence
function last() : IObservable
The returned sequence completes when the source sequence completes with values.
The returned sequence errors when the source sequences errors or if the source sequence completes without any values
xs = source ys = output
xs ──o───o─o────o──/ │ └──┐ │ ys ────────────────o/
xs ────────────────/ │ │ │ ys ────────────────x
IObservable.<sourceType>
var source : IObservable = Observable.range(0, 5)
.last();
source.subscribeFunc(
function(value : int) : void { trace(value; },
function() : void { trace("Completed!"); }
);
// Trace output is:
// 4
// Completed!