Created
February 14, 2018 13:29
-
-
Save caioregatieri/e34e859a1ae0cc3f4f9081fe105b3347 to your computer and use it in GitHub Desktop.
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 characters
function debounce(fn, delay){ | |
let timer = null | |
return function(){ | |
clearTimeout(timer) | |
setTimeout(function(){ | |
fn() | |
}, delay) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment