Created
November 6, 2017 07:32
-
-
Save sharmaabhinav/09e3c2a833043b7e74b4f33bd467e5ab 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) { | |
var timer = null | |
return function () { | |
var args = arguments | |
clearTimeout(timer) | |
timer = setTimeout(function () { | |
fn.apply(null, args) | |
}, delay) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment