var i = 0;
// Repeat until condition no longer holds
var source = Rx.Observable.while(
function () { return i++ < 3 },
Rx.Observable.return(42)
);
var subscription = source.subscribe(
function (x) { console.log('Next: ' + x); },
function (err) { console.log('Error: ' + err); },
function () { console.log('Completed'); });