skip to content

interval

 

interval will emit sequential numbers with a given interval (first emission being delayed by that interval)

1
2
3
4
5
6
7
8
9
10
const { rxObserver } = require('api/v0.3');
const { interval } = require('rxjs');
const { take } = require('rxjs/operators');

interval(5).pipe(
    take(10)
  )
  .subscribe(rxObserver());

0msstartcomplete00 11 22 33 44 55 66 77 88 99

To specify an initial delay, see timer(10, 5) example