-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
useDebounceFn: Stop debouncing #3375
Comments
For the ones interested, here is an incomplete an naive implementation of a wrapper of the existing useDebounceFn:
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
A shame this issue got closed, it would be good to have a way to stop a debounce from happening. Example use case is a popper which has a debounced open/close. If open is called while a close debounce is to be executed, it would be good to cancel the close. |
Reopen, please |
Reopen please. We needed this specific functionality, so we need to stop using this now. |
I was having this issue with forms sending command right after they fetch their values....
|
Clear and concise description of the problem
I'd like to have the possibility of stopping the execution of a debounced function that is already planned to be executed in the future.
Example use case: I have an input control where typing would open a panel for autocompletions/suggestions. The typing keyboard events are debounced so that the panel shows after some delay (may be due to avoid the panel doing unecessary network fetches for example). I would also need the escape key to close the panel straight away and/or cancel the fetch, without waiting. But in that case, if they were some keys pressed just before the escape key, the debounce effect is already running and will ultimately re-opens the closed panel. Ideally, I'd like to cancel the planned debounce effect execution before it occurs.
Suggested solution
This would require breaking changes in the api.
Alternative
Current alternative is some custom code to track events in the timeline.
Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: