react-toolkit icon indicating copy to clipboard operation
react-toolkit copied to clipboard

feat: add useDebouncedCallback hook

Open yyyyaaa opened this issue 2 years ago • 0 comments

Why

This feature emerged from one of our current project Droppii where we need to control the firing rate of a function

How is this different from the existing useDebounce hook?

Our existing useDebounce hook only control the rate of a value, we could theoretically use that to implement a similar effect of debounced callbacks but in practice many callbacks don't depend on any values, so there's no value to anchor for useDebounce to work.

cc @zlatanpham

yyyyaaa avatar Feb 07 '23 00:02 yyyyaaa