-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
fix(useThrottleFn): trailing
option should be false
by default
#1687
Conversation
I just saw this in the BREAKING CHANGES section of the release notes. The correct behaviour should be to only call the function after expiration of the timeout if any throttled call occured since the last call which was forwarded to the wrapped function. This is also how underscore implements it IIRC. I am not sure what you refer to by "design principles of throttle function". The event will still only be called at most once per interval. And those which would like the other behaviour can use It remember there was a way to search all of github how some APIs were used which could be used to confirm that most people use the previous default though I am not sure how to do this (the normal github search is not really suited for this) |
@antfu I see that v9 is released now. Could this be reconsidered for v10? |
Or at least add a TIP/WARNING box like it is done for some other function about this behaviour |
Also all other throttle related helpers |
Yeah I think it's reasonable to have it default to @septatrix You can send a PR to change it back and so we could ship it in v10 |
Sure thing! |
Sorry I currently cannot say when I will have time to work on this |
Description
Close #1684
Follow the design principles of
throttle function
,I think we shouldn't call fn again by default after the time is up .Additional context
What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123
).