- RxJS Tutorial
- RxJS - Home
- RxJS - Overview
- RxJS - Environment Setup
- RxJS - Latest Updates
- RxJS - Observables
- RxJS - Operators
- RxJS - Working with Subscription
- RxJS - Working with Subjects
- RxJS - Working with Scheduler
- RxJS - Working with RxJS & Angular
- RxJS - Working with RxJS & ReactJS
- RxJS Useful Resources
- RxJS - Quick Guide
- RxJS - Useful Resources
- RxJS - Discussion
RxJS - Creation Operator interval
This operator will create an Observable every time for the time given.
Syntax
interval(time): Observable
Parameters
time − The time given is in milliseconds.
Return value
It returns an observable, that will give a sequential number for the timeinterval given.
Example
import { interval } from 'rxjs'; import { take } from 'rxjs/operators'; let test = interval(2000); let case1 = test.pipe(take(5)); case1.subscribe(x => console.log(x));
Output
Advertisements
To Continue Learning Please Login
Login with Google