Skip to content
This repository has been archived by the owner on Apr 20, 2018. It is now read-only.

Latest commit

 

History

History
56 lines (44 loc) · 1.88 KB

toarray.md

File metadata and controls

56 lines (44 loc) · 1.88 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: