Skip to content

Latest commit

 

History

History
55 lines (43 loc) · 1.8 KB

toarray.md

File metadata and controls

55 lines (43 loc) · 1.8 KB

Rx.Observable.prototype.toArray()

Creates a list from an observable sequence.

Returns

(Observable): An observable sequence containing a single element with a list containing all the elements of the source sequence.

Example

var source = Rx.Observable.timer(0, 1000)
    .take(5)
    .toArray();

var subscription = source.subscribe(
    function (x) {
        console.log('Next: ' + x);
    },
    function (err) {
        console.log('Error: ' + err);
    },
    function () {
        console.log('Completed');
    });

// => Next: [0,1,2,3,4]
// => Completed

Location

File:

Dist:

Prerequisites:

  • None

NPM Packages:

NuGet Packages:

Unit Tests: