debouce dengan fungsi javascript fungsi debounce yang jelas

 const clearDebouncer = (name)=>{
     clearTimeout(global[name]);
     window[name] = undefined;
 }
 const debounceFunction = (func,timer, name)=>{
     clearDebouncer(name)
     window[name] = setTimeout(() => {
     func()
 }, timer);
 }
Husnain Syed