I am new to rxjs and was playing around with them. So here's the code that emits values every second.And since it passes through the delay operator which is set for 10 secs, I was expecting the output to be consoled every 11 secs,
import { of,interval } from 'rxjs';
import { map,delay,timeInterval } from 'rxjs/operators';
interval(1000)
.pipe(delay(10000))
.pipe(timeInterval())
.subscribe(val=>{
console.log(val);
});
Which was the case the first time. And after that it started consoling output every second instead of 11 secs. How does this happen? Here's the output for your reference.
TimeInterval {value: 0, interval: 11004}
TimeInterval {value: 1, interval: 997}
TimeInterval {value: 2, interval: 1000}
TimeInterval {value: 3, interval: 1003}
TimeInterval {value: 4, interval: 997}
TimeInterval {value: 5, interval: 1000}
...