(callback, ms)
| 475 | } |
| 476 | var _throttleTimeout; |
| 477 | function throttle(callback, ms) { |
| 478 | return function () { |
| 479 | if (!_throttleTimeout) { |
| 480 | var args = arguments, |
| 481 | _this = this; |
| 482 | if (args.length === 1) { |
| 483 | callback.call(_this, args[0]); |
| 484 | } else { |
| 485 | callback.apply(_this, args); |
| 486 | } |
| 487 | _throttleTimeout = setTimeout(function () { |
| 488 | _throttleTimeout = void 0; |
| 489 | }, ms); |
| 490 | } |
| 491 | }; |
| 492 | } |
| 493 | function cancelThrottle() { |
| 494 | clearTimeout(_throttleTimeout); |
| 495 | _throttleTimeout = void 0; |
no outgoing calls
no test coverage detected
searching dependent graphs…