This is RxJS v 4. Find the latest version here
Repeats source as long as condition holds emulating a do while loop.
condition
(Function
): The condition which determines if the source will be repeated.
(Observable
): An observable sequence whose observers trigger an invocation of the given observable factory function.
var i = 0;
var source = Rx.Observable.return(42).doWhile(function (x) { return ++i < 2; });
var subscription = source.subscribe(
function (x) {
console.log('Next: %s', x);
},
function (err) {
console.log('Error: %s', err);
},
function () {
console.log('Completed');
});
// => Next: 42
// => Next: 42
// => Completed
File:
Dist:
Prerequisites:
NPM Packages:
NuGet Packages:
Unit Tests: