bug(throttle): Does not emit last value on source complete
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 31.7k
- Forks
- 3k
- PR merge metrics
- No merged PRs in 30d
Description
throttleTime(n, s, config) should be equivalent to throttle(() => timer(n, s), config)... But it's not. The issue is that throttle does not behave correctly when the source completes.
If the source completes, we're trailing, and we have a trailing value already, the result should wait for the throttle duration to end, then emit the last value, then complete the result. If the source completes and we don't have a trailing value -- or we're not trailing -- the result should complete.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the throttle and throttleTime implementations and their existing tests. Reproduce completion with trailing enabled and a pending trailing value, then verify that the final value is emitted after the throttle duration before the result completes; cases without a trailing value should complete directly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100