-
Notifications
You must be signed in to change notification settings - Fork 8
take
richardszalay edited this page May 20, 2011
·
10 revisions
Emits a set number or values from the start of the source sequence before completing.
function take(count : uint) : IObservable.<T>
The returned sequence completes when the source sequence completes or when count values have been emitted.
The returned sequence errors when the source sequences errors
x = count
xs ──o──o─────o
1 2 ... n
│ │ │
ys ──o──o─────o/
IObservable.<T>
Observable.range(0, 5)
.take(3)
.subscribe(function(value : int) : void
{
trace(value);
});
// Trace output is:
// 0
// 1
// 2