UNPKG

react-native-debounce-search

Version:

This package is for implementing smooth search funcanility in react native app with debouncing

16 lines (15 loc) 257 B
class useDebounce { handler; constructor() {} add(callback, delay) { handler = setTimeout(() => { if (callback) { callback(); } }, delay); } remove() { clearTimeout(handler); } } export default new useDebounce();