react-debounce-throttle
v1.0.1
Published
Ultra-lightweight debounce and throttle hooks for React
Maintainers
Readme
react-debounce-throttle
Ultra-lightweight (1–2 KB) debounce and throttle hooks for React.
Optimize your React applications by controlling the rate of function calls and improving performance in real-time scenarios like search inputs, scrolling, and button clicks.
Features
- ✅ useDebounce – Run a function only after a delay, perfect for search inputs or validation.
- ✅ useThrottle – Run a function at most once per interval, ideal for scroll events, mouse moves, or rapid button clicks.
- ✅ Tiny size (~1–2 KB) – Extremely lightweight and easy to integrate.
- ✅ Fully compatible with React 16.8+ (hooks support).
- ✅ Simple API – just import and use, no extra configuration required.
Installation
npm install react-debounce-throttle