-
Notifications
You must be signed in to change notification settings - Fork 576
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
useDebouncedFn clearing timeouts #56
Comments
Hiya @ayarushin A |
Sounds great! I'll do it |
@ayarushin great, man! thank you Please be sure to return a debounced function to avoid introducing a breaking change also make sure to document how to possibly clear the debounced one. The lodash approach looks quite good to me, something like: const debouncedFn = useDebouncedFn(myCallback, 250);
debouncedFn.cancel(); |
mmmhhh, that's weird since useCallback shall return a memoized (so a new) version of the function, perhaps it takes care of keeping the static properties somehow. Anyway, the whole thing still needs to be documented, so feel free to open a PR about that if you want :) |
Hey,
As I can see you don't use
debounced.cancel()
here for clearing timeout.Am I right or I missed something? :)
The text was updated successfully, but these errors were encountered: