#5732·rxjs

bug(throttle): Does not emit last value on source complete

Author: benleshCreated Sep 15, 2020Updated Jul 25, 2026
Labelsbug

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.