Overview
Emits a value from the source Observable, then ignores subsequent source values for a duration determined by another Observable, then repeats this process.throttle is similar to audit, but emits the first value from the silenced time window instead of the last value.Type Signature
Parameters
A function that receives a value from the source Observable, for computing the silencing duration for each source value, returned as an ObservableInput.
Configuration object to define
leading and trailing behavior.leading: Iftrue, emit the first value (default:true)trailing: Iftrue, emit the last value when duration completes (default:false)
Returns
MonoTypeOperatorFunction<T> - A function that returns an Observable that performs the throttle operation.
Usage Examples
Basic Example
With Config
Related Operators
- throttleTime - Same behavior but with fixed duration
- audit - Emits last value instead of first
- auditTime - Like audit but with fixed duration
- debounce - Waits for silence before emitting
- sample - Samples when another Observable emits
