Created
November 27, 2020 01:54
-
-
Save the-glima/edc1f6559224c9a169a9a4502cf5bb62 to your computer and use it in GitHub Desktop.
Revisions
-
the-glima created this gist
Nov 27, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ const debounce = (callback: Function, delay: number) => { let timeout: any; return (...args: any) => { clearTimeout(timeout) timeout = setTimeout(() => { timeout = null callback(...args) }, delay) } }