Skip to main content

Command Palette

Search for a command to run...

Debouncing technique in javascript

Published
1 min readView as Markdown

let counter = 0; function getData(){ console.log("functionc alled"); }

function myDebounce(call, d){ let timer; return function(...args){ if(timer) clearTimeout(timer); setTimeout(function() { call(); }, d); } }

const betterFunction = myDebounce(getData, 1000)

More from this blog

Chowhan's blog

29 posts

A Passionate software developer