Skip to content

Instantly share code, notes, and snippets.

@stecb
Last active August 29, 2015 14:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stecb/3d69cb249cfe10bf5ccf to your computer and use it in GitHub Desktop.
Save stecb/3d69cb249cfe10bf5ccf to your computer and use it in GitHub Desktop.
Throttling function
function throttle(e,t){var n,r;return null==t&&(t=100),r=null,n=null,function(){var i,s,o;return s=+(new Date),o=this,i=arguments,n&&n+t>s?(clearTimeout(r),r=setTimeout(function(){return n=s,e.apply(o,i)},t)):(n=s,e.apply(this,i))}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment