define(function () { return function (func, limit) { var timeout; var inThrottle; return function () { var context = this, args = arguments; if (!inThrottle) { func.apply(context, args); inThrottle = true; } setTimeout(() => inThrottle = false, limit); }; }; });