
export default function useDebounce(callback, delay = 500) {
  let timer = null;
  return (...args) => {
    if (timer) clearTimeout(timer)
    timer = setTimeout(() => {
      callback(...args);
    }, delay);
  }
}