xnimorz / use-debounce

A debounce hook for react
MIT License
2.98k stars 113 forks source link

Recall debounceCallback with latest arguments #186

Open ManuLpz4 opened 3 weeks ago

ManuLpz4 commented 3 weeks ago

Hey, guys! How is it going? I think that it would be great to have a new method to restart the debounce timer like restart() or recall(). Is the same as calling again the function with the last arguments, I think a useRef() hook is more than enough to achieve it.

What do you think?

xnimorz commented 3 weeks ago

Hello @ManuLpz4

Could you elaborate on practical use-cases for that, please? I am trying to understand why it might be needed