sdr34 / react-hook-kit

React Hook Kit: A TypeScript library of reusable custom hooks for accelerating React application development.
MIT License
4 stars 3 forks source link

Implement useDebounce and useThrottle hooks #5

Closed sdr34 closed 1 year ago

sdr34 commented 1 year ago

This issue is a feature request for the implementation of two new custom hooks: useDebounce and useThrottle.

The useDebounce hook will be used to limit the rate at which a function can fire. This is useful when we have a function that we need to execute, but we don’t want it to execute until after a certain amount of time has passed since it was last invoked.

The useThrottle hook will be used to ensure that a function cannot be called more than once every X milliseconds. This can be helpful in situations where we want to make sure that a certain function is not called too often, such as a resize or scroll event listener in a web application.

Both of these hooks will provide a better user experience by improving the performance of our application.

Looking forward to the community's thoughts and contributions on this!