timer
observable accept 2 arguments, initialDelay
and period
initialDelay
import { timer } from 'rxjs';
// delay 1 second to emit event
const source$ = timer(1000);
initialDelay
and period
import { timer } from 'rxjs';
// delay 2 second and emit event every 1s
const source$ = timer(2000, 1000);
Official Doc: rxjs.timer