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
var throttle works like debounce
If is ok for you - you should rename throttle to debounce.
If you expect throttle behavior - function is not implemented it
It's actually a good question which behavior is "correct" or wanted here. It's subjective I guess, and also back in 2012 there may have been a higher priority to just resize once (debounce) whereas looking at this today I wouldn't mind throttle behavior either, as it would allow to drag the border of a browser window many seconds and see the presentation follow behind.
Interestingly, the code comment references the very same blog post from Remy Sharp as your StackOverflow answer: https://remysharp.com/2010/07/21/throttling-function-calls Clearly the function body is the debounce function from that blog post, yet for some reason the creator of impress.js chose to call it throttle.
I think it's ok to rename as debounce, to be semantically correct, and thanks for opening this issue.
https://github.com/impress/impress.js/blob/master/src/lib/util.js#L65-L74
The text was updated successfully, but these errors were encountered: