This is RxJS v 4. Find the latest version here
** DEPRECATED - Use Rx.Observable.from instead** Rx.Observable.fromArray(array, [scheduler])
Converts an array to an observable sequence, using an optional scheduler to enumerate the array.
array
(Array): An array to convert to an Observable sequence.[scheduler=Rx.Scheduler.currentThread]
(Scheduler
): Scheduler to run the enumeration of the input sequence on.
(Observable
): The observable sequence whose elements are pulled from the given enumerable sequence.
var array = [1,2,3];
var source = Rx.Observable.fromArray(array);
var subscription = source.subscribe(
function (x) {
console.log('Next: ' + x);
},
function (err) {
console.log('Error: ' + err);
},
function () {
console.log('Completed');
});
// => Next: 1
// => Next: 2
// => Next: 3
// => Completed
File:
Dist:
Prerequisites:
- None
NPM Packages:
NuGet Packages:
Unit Tests: