Skip to content

Latest commit

 

History

History
59 lines (46 loc) · 2.44 KB

repeat.md

File metadata and controls

59 lines (46 loc) · 2.44 KB

Rx.Observable.repeat(value, [repeatCount], [scheduler])

Generates an observable sequence that repeats the given element the specified number of times, using the specified scheduler to send out observer messages.

Arguments

  1. value (Any): Element to repeat.
  2. [repeatCount=-1] (Number):Number of times to repeat the element. If not specified, repeats indefinitely.
  3. [scheduler=Rx.Scheduler.immediate] (Scheduler): Scheduler to run the producer loop on. If not specified, defaults to Scheduler.immediate.

Returns

(Observable): An observable sequence that repeats the given element the specified number of times.

Example

var source = Rx.Observable.repeat(42, 3);

var subscription = source.subscribe(
    function (x) {
        console.log('Next: ' + x);
    },
    function (err) {
        console.log('Error: ' + err);
    },
    function () {
        console.log('Completed');
    });

//=> Next: 42
// => Next: 42
// => Next: 42
// => Completed

Location

File:

Dist:

Prerequisites:

NPM Packages:

NuGet Packages:

Unit Tests: