throttle-js

'use strict'; var throttle = function (interval, fn) { var lastExecution = Date.now() - interval; return function () { if ((lastExecution + interval) <= Date.now()) { lastExecution = Date.now(); fn.apply(this, arguments); } }; };

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.