-
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
Invalid behavior of ThrottleTime operator #3712
Comments
I was able to reproduce this behavior and implement a failing marble test case that I think matches what you're seeing. I can use some help confirming that this is indeed the expected behavior: const dueTime = time('|');
const period = time('---|');
const throttle = time('-----| ');
const expected = 'a----b----c----d----e(f|)';
const source = timer(dueTime, period, rxTestScheduler).take(8).throttleTime(throttle, rxTestScheduler, { leading: true, trailing: true });
const values = { a: 0, b: 1, c: 3, d: 4, e: 6, f: 7};
expectObservable(source).toBe(expected, values); Want to make sure this is correct before attempting to implement a fix. |
Hi @bbonnet , what does |
So this means that the throttle timer would emit |
Tried to fix that in #2749 but gave up getting it into rxjs and just use my own operator. |
…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
RxJS version:
5.5.8
6.1.0
rxjs-compat 6.1.0
Code to reproduce:
This is RxJs behavior
5.5.8
6.1.0
Expected behavior:
This is underscore:
This is RxSwift behavior
Actual behavior:
Additional information:
The operator
throttleTime
is not behaving as I would expect. If I set throttle interval to 1sec I should never receive elements under 1 sec.The text was updated successfully, but these errors were encountered: