Skip to content
This repository has been archived by the owner on Apr 20, 2018. It is now read-only.

Latest commit

 

History

History
63 lines (50 loc) · 2.13 KB

repeatproto.md

File metadata and controls

63 lines (50 loc) · 2.13 KB

Rx.Observable.prototype.repeat(repeatCount)

Repeats the observable sequence a specified number of times. If the repeat count is not specified, the sequence repeats indefinitely.

Arguments

  1. repeatCount (Number): Number of times to repeat the sequence. If not provided, repeats the sequence indefinitely.

Returns

(Observable): The observable sequence producing the elements of the given sequence repeatedly.

Example

var source = Rx.Observable.range(1, 3)
    .repeat(2);

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

// => Next: 1
// => Next: 2
// => Next: 3
// => Next: 1
// => Next: 2
// => Next: 3
// => Completed

Location

File:

Dist:

Prerequisites:

  • None

NPM Packages:

NuGet Packages:

Unit Tests: