We are creating a “Interval” Rxjs Operator for the time specify 1 second that return the value 1,2,3,4… etc, This is call as simply as a method Interval:-
const interval$ = interval(1000);
interval.subscribe((val)=> {
console.log(“interval val: ” val)
})
// return 1,2,3,4,5…… Timer:- takes two arguments
1- First take initial delay before start
2-Second time interval const timer$ = timer(3000,1000)
timer.subscribe((val)=> {
console.log(“timer ” val)
})