-
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
How is throttle
supposed to be used?
#649
Comments
But if I understand you correctly, then If I wait long enough on my example I should see another |
Note: If I remove the call to |
No, Throttle takes one, then drops all until the timer (of 2000) is up, then takes one and starts the timer again, dropping everything. |
Sorry, I'm not sure to follow you. Here my concern is really not about "when", it is about "what". Please have a look at my example again to consider the following: In the console after an "infinite" time you would see the same thing whether you run this: // The fact that the time is 1, 100 or 2000 is not the problem I'm concern with right now
obs.throttle(25).subscribe(function (value) { console.log(value); }); or this: // This code produce the same thing if we ignore the time
obs.delay(25).take(1).subscribe(function (value) { console.log(value); }); The fact that I think this is not intended behaviour because discussion #480 seems to imply that in my example, If I
But what we're seeing when running the code is this:
What do you think? |
Note: Maybe in my example this wasn't super clear, but the |
@Nemikolh it looks like #496 we still have some work to do around In the end though the behavior should look like this: var someObservable = cold('---x------x------x------x------x---|');
var someDuration = 100; // '----------|';
// '----------|';
var expected = '---x------------x--------------x---|';
expectObservable(someObservable.throttleTime(someDuration)).toBe(expected); ... if that makes sense. |
Is it okay to close this issue, since it's just a question? Or would you rather I keep it open for a while to see if someone else chimes in? |
Not a problem, if you need anything else, please don't hesitate to drop another issue, or hit me up on twitter. |
Hello everyone!
I'm having a hard time to understand the logic behind the
throttle
operator. I assume I'm missing something.With the 5.0.0-alpha.7 version of the library when I do:
The only result I get is:
While I was expecting something like
I run that code by simply doing:
Is it a bug or is it because the default scheduler need some triggering from my part ?
Best,
Nemikolh
The text was updated successfully, but these errors were encountered: