This is RxJS v 4. Find the latest version here
Creates an observable sequence with a single item of a Set created from the observable sequence. Note that this only works in an ES6 environment or polyfilled.
(Observable
): An observable sequence containing a single element with a Set containing all the elements of the source sequence.
var source = Rx.Observable.timer(0, 1000)
.take(5)
.toSet();
var subscription = source.subscribe(
function (x) {
var arr = [];
x.forEach(function (i) { arr.push(i); })
console.log('Next: ' + arr);
},
function (err) {
console.log('Error: ' + err);
},
function () {
console.log('Completed');
});
// => Next: [0,1,2,3,4]
// => Completed
File:
Dist:
NPM Packages:
NuGet Packages:
Unit Tests: