[docs]: Operator `throttleTime` is missing an example for the throttleConfig param
Documentation Related To Component:
The throttleTime operator:
throttleTime.ts
Please check those that apply
- [ ] typo
- [ ] documentation doesn't exist
- [x] documentation needs clarification
- [ ] error(s) in example
- [x] needs example
We may want to include a description for throttleConfig param. Also, the see also section is incomplete.
Description
The detailed description can be improved. Here we should include that:
- there is an optional config param
See Also
We miss some operators in the see also section.
A suggested list for related operators could look like this:
* @see {@link delay}
* @see {@link delayWhen}
* @see {@link audit}
* @see {@link auditTime}
* @see {@link debounce}
* @see {@link debounceTime}
* @see {@link sample}
* @see {@link sampleTime}
* @see {@link throttle}
Would it make sense to also mention that configurability in the description?
Current description totally disregards that:
Emits a value from the source Observable, then ignores subsequent source values for duration milliseconds, then repeats this process.
We could add something to mention that, e.g.
Can be configured to ignore the first value and|or also emit the last value within given duration.
I personally missed that option, probably due to rather strict description of the behavior.
The new throttleTime behavior with { leading: true, trailing: true } is not documented, neither in the operator page (https://rxjs.dev/api/operators/throttleTime) nor in the v7 breaking changes page. The operator marble image also still shows the old behavior, where both the last and the first event is emitted, even if the time between them is smaller than the throttle time. I noticed the new behavior through unit testing.
Same issue, the graph shows
while the api is throttleTime<T>(duration: number, scheduler: SchedulerLike = asyncScheduler, config?: ThrottleConfig): MonoTypeOperatorFunction<T>
https://rxjs.dev/api/operators/throttleTime