Last active
September 19, 2016 21:57
-
-
Save Luardi/4583fafe34831b43e54a5c680a9e79bc 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
var throttle = function(func, thottleTimeout) { | |
var state = null; | |
var stop = 1; | |
return function() { | |
if (state) return; | |
func.apply(this, arguments); | |
state = stop; | |
setTimeout(function() { state = null }, thottleTimeout); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment