-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
throttleTime(n, undefined, {leading: true, trailing: true}) ... double output #2727
Comments
Has anybody found a work around on this ? |
Hi jscti, I think the work around for that might be to to give up on leading value. .throttleTime(1234, undefined, {leading: false, trailing: true}) Note that in this case you will be missing the first value. And there is also opened issue for single value #2859. |
Fix an issue with throttleTime emitting both leading and trailing values in the same time window. Double emission problem: source: a123b12-c-23d-2-ef--- expected: a---b---c---d---e---f actual: a---b1---c2---2-e---f Closes ReactiveX#2466 and ReactiveX#2727. Follows ReactiveX#2749 and ReactiveX#2864. BREAKING CHANGE: throttleTime no longer emits both leading and trailing values in the same time window.
Would |
Yes it would work, for example:
|
Well, let me try to propose a fix again via #4864 :D |
Fix an issue with throttleTime emitting both leading and trailing values in the same time window. Double emission problem: source: a123b12-c-23d-2-ef--- expected: a---b---c---d---e---f actual: a---b1---c2---2-e---f Closes ReactiveX#2466 and ReactiveX#2727. Follows ReactiveX#2749 and ReactiveX#2864. BREAKING CHANGE: throttleTime no longer emits both leading and trailing values in the same time window.
Are there any plans to merge it? |
…least the throttled amount Works to align the behavior with expectations set by lodash's throttle - Updates tests - Ensures trailing throttle will wait to notify and then complete - Ensures that every time we emit a value a new throttle period starts fixes ReactiveX#3712 related ReactiveX#4864 fixes ReactiveX#2727 closes ReactiveX#4727 related ReactiveX#4429
…least the throttled amount Works to align the behavior with expectations set by lodash's throttle - Updates tests - Ensures trailing throttle will wait to notify and then complete - Ensures that every time we emit a value a new throttle period starts fixes ReactiveX#3712 related ReactiveX#4864 fixes ReactiveX#2727 closes ReactiveX#4727 related ReactiveX#4429
…least the throttled amount (#5687) * fix(throttleTime): ensure the spacing between throttles is always at least the throttled amount Works to align the behavior with expectations set by lodash's throttle - Updates tests - Ensures trailing throttle will wait to notify and then complete - Ensures that every time we emit a value a new throttle period starts fixes #3712 related #4864 fixes #2727 closes #4727 related #4429 * chore: Address comments and add comments to the code
Oh nice, thank you for fixing it ben 🥳 |
RxJS version: 6.5.1
Code to reproduce (6.5.1): https://stackblitz.com/edit/rxjs-tthiju
Expected behavior: One value initially, then defer next value for given
duration
Actual behavior: One value initially, two values each
duration
Additional information:
Test:
The text was updated successfully, but these errors were encountered: