In RxJS, filters such as auditTime
and throttleTime
emit an Observable (in different ways) after a certain duration has passed. I need to emit an Observable and then wait for a period of time before emitting the next value.
In my case I am working in Angular. For example, this code:
this.fooService$.pipe(throttleTime(10000)).subscribe(() => this.doSomething());
will not accomplish what I need because the emission happens at the end of the duration. I need the opposite: the emission happens and then a delay. How can I accomplish this?
leading
andtrailing
options might be what you are looking for: github.com/ReactiveX/rxjs/blob/6.3.3/spec/operators/… – cartantthrottle()
– CruelEngine