RxJS - Creation Operator timer



This operator will create an observable that will emit the value after the timeout and the value will keep increasing after each call.

Syntax

timer(dueTime: number | Date): Observable

Parameters

dueTime − The dueTime can be in milliseconds or date.

Return value

An observable that will emit the value after the timeout and the value will keep increasing after each call.

Example

import { timer, range } from 'rxjs';

let all_numbers = timer(10, 10);
all_numbers.subscribe(x => console.log(x));

Output

timer Operator
Advertisements