Skip to content

Latest commit

 

History

History
43 lines (26 loc) · 1.12 KB

repeat.md

File metadata and controls

43 lines (26 loc) · 1.12 KB

repeat

signature: repeat(count: number): Observable

Repeats the stream of items emitted by the source Observable at most count times.

Examples

Example 1: Repeat 3 times

( StackBlitz )

// RxJS v6+
import { repeat, delay } from 'rxjs/operators';
import { of } from 'rxjs';

const delayedThing = of('delayed value').pipe(delay(2000));

delayedThing.pipe(
  repeat(3)
)
.subscribe(console.log)

Related Recipes

Additional Resources


📁 Source Code: https://github.com/ReactiveX/rxjs/blob/master/src/internal/operators/repeat.ts