You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To debounce means "call this at most once per N ms". All outward function calls get collated into a single inward call, and only the latest (most recent) arguments as passed on to the debounced function.
What you're doing is throttling, not debouncing. lodash.throttle:
Creates a throttled function that only invokes func at most once per every wait milliseconds.
Creates a debounced function that delays invoking func until after wait milliseconds have elapsed since the last time the debounced function was invoked.
And while on the topic, a (real) @debounce would be a great addition.
The text was updated successfully, but these errors were encountered:
Agreed! It's a difficult thing to change now that its there, but what about adding an option and making the default an actual debounce? @pl12133 called this out to me a couple weeks ago, I'd forgotten about the name mixup.
The sooner you do it the better if you see a future for this package. We have enough misnamed "oh-it's-too-late-now" stuff in the web dev industry as it is :)
I'd love to have a real debounce option here somehow. Separating throttle and debounce would make a lot of sense. Also core-decorators seems to have deprecated their debounce and throttle decorators for some reason
In the docs its says:
What you're doing is throttling, not debouncing.
lodash.throttle:
lodash.debounce:
And while on the topic, a (real)
@debounce
would be a great addition.The text was updated successfully, but these errors were encountered: