3 static DEFAULT_THROTTLE = 1;
5 public static throttle(fn: Function, threshold = Perf.DEFAULT_THROTTLE, context?: any): Function {
6 let last: any, deferTimer: any;
10 const scope = context || this;
14 if (last && now < last + threshold) {
15 clearTimeout(deferTimer);
16 deferTimer = setTimeout(function () {
18 fn.apply(scope, args);
22 fn.apply(scope, args);