throttle
signature: throttle(durationSelector: function(value): Observable | Promise): Observable
throttle(durationSelector: function(value): Observable | Promise): Observable
Emit value on the leading edge of an interval, but suppress new values until durationSelector
has completed.
durationSelector
has completed.Examples
Example 1: Throttle for 2 seconds, based on second observable
( StackBlitz | jsBin | jsFiddle )
Example 2: Throttle with promise
( StackBlitz | jsBin | jsFiddle )
Additional Resources
throttle 📰 - Official docs
Filtering operator: throttle and throttleTime 🎥 💵 - André Staltz
📁 Source Code: https://github.com/ReactiveX/rxjs/blob/master/src/internal/operators/throttle.ts
Last updated