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
Use case: I want to publish an update to a websocket at most any given time.Duration. So basically like the already existing debounce, but limiting with delay, not delaying until end.
Working with onboard functions, I came up with something like this:
So in the end, calling throttle() will put the rounded nano time in a bucket for debounce and that bucket will be triggered after delay is no longer inside the same rounding range.
Not sure what to do with cancel though.
The text was updated successfully, but these errors were encountered:
Based on lodash _.throttle.
Use case: I want to publish an update to a websocket at most any given
time.Duration
. So basically like the already existing debounce, but limiting with delay, not delaying until end.Working with onboard functions, I came up with something like this:
So in the end, calling
throttle()
will put the rounded nano time in a bucket for debounce and that bucket will be triggered afterdelay
is no longer inside the same rounding range.Not sure what to do with
cancel
though.The text was updated successfully, but these errors were encountered: