Skip to content

Latest commit

 

History

History
54 lines (41 loc) · 1.98 KB

dowhile.md

File metadata and controls

54 lines (41 loc) · 1.98 KB

Rx.Observable.prototype.doWhile(condition)

Repeats source as long as condition holds emulating a do while loop.

Arguments

  1. condition (Function): The condition which determines if the source will be repeated.

Returns

(Observable): An observable sequence whose observers trigger an invocation of the given observable factory function.

Example

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

Location

File:

Dist:

Prerequisites:

NPM Packages:

NuGet Packages:

Unit Tests: