throttleTime
signature: throttleTime(duration: number, scheduler: Scheduler): Observable
Example 1: Receive latest value every 5 seconds
Example 2: Throttle merged observable
import { merge } from 'rxjs/observable/merge';
import { throttleTime, ignoreElements } from 'rxjs/operators';
const source = merge(
//emit every .75 seconds
interval(750),
);
//throttle in middle of emitted values
const example = source.pipe(throttleTime(1200));
//output: 0...1...4...4...8...7
Additional Resources
- Filtering operator: throttle and throttleTime
- André Staltz