-
Notifications
You must be signed in to change notification settings - Fork 8
toArray
richardszalay edited this page May 20, 2011
·
2 revisions
Buffers all the values from the sequence and emits them as an array when the sequence completes.
function toArray() : IObservable.<Array>
The returned sequence completes when the source sequence completes
The returned sequence raises an error if the source sequence raises an error error.
0 1 3 4
xs ─o──o──o──o──/
|
ys ─────────────o/
[0,1,2,3,4]
IObservable.<Array>
Observable.range(0, 10)
.toArray()
.subscribe(
function(values : Array) : void
{
trace(values.join(", "));
});
// Trace output is:
// 0, 1, 2, 3, 4, 5, 6, 7, 8, 9