Last active
July 13, 2018 04:45
-
-
Save langjt/dcfa2425b249851de96ad8cb7e0509b0 to your computer and use it in GitHub Desktop.
This file contains 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 timeout; | |
return function() { | |
var _this = this; | |
var _arguements = arguments; | |
clearTimeout(timeout); | |
timeout = setTimeout(function() { | |
fn.apply(_this, _arguements); | |
}, delay); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment