forked from richardszalay/raix
-
Notifications
You must be signed in to change notification settings - Fork 0
takeLast
richardszalay edited this page May 20, 2011
·
8 revisions
Takes only the last set number of values from a source sequence
function takeLast(count : uint) : IObservable.<T>
The returned sequence completes when the source sequence completes.
The returned sequence errors when the source sequences errors
xs ──o──o──o──o──/
0 1 2 3 │
│
ys ──────────────o─o─o─/
1 2 3
IObservable.<T>
Observable.range(0, 5)
.takeLast(3)
.subscribe(function(value : int) : void
{
trace(value);
});
// Trace output is:
// 2
// 3
// 4