Describe the feature in detail (code, mocks, or screenshots encouraged)
Context
I frequently use the use-debounce hook in my application to manage delayed function executions. However, there are scenarios, such as when closing a modal, where I need to immediately trigger the scheduled debounced callback instead of waiting for the remaining debounce period. This functionality would be especially beneficial in ensuring that important callbacks are not lost or delayed when the debounce period is no longer relevant.
Request
I am requesting an enhancement to the use-debounce hook that allows for the immediate resolution of any scheduled callbacks. This could be implemented via a method (e.g., resolveNow) that forces the execution of the debounced function at the current time, bypassing any remaining debounce delay.
Describe the feature in detail (code, mocks, or screenshots encouraged)
Context
I frequently use the use-debounce hook in my application to manage delayed function executions. However, there are scenarios, such as when closing a modal, where I need to immediately trigger the scheduled debounced callback instead of waiting for the remaining debounce period. This functionality would be especially beneficial in ensuring that important callbacks are not lost or delayed when the debounce period is no longer relevant.
Request
I am requesting an enhancement to the use-debounce hook that allows for the immediate resolution of any scheduled callbacks. This could be implemented via a method (e.g., resolveNow) that forces the execution of the debounced function at the current time, bypassing any remaining debounce delay.
What type of pull request would this be?
Enhancement
Provide relevant links or additional information.
https://runed.dev/docs/utilities/use-debounce