react-toolkit
react-toolkit copied to clipboard
feat: add useDebouncedCallback hook
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