MCPcopy Index your code
hub / github.com/SortableJS/Sortable / throttle

Function throttle

Sortable.js:477–492  ·  view source on GitHub ↗
(callback, ms)

Source from the content-addressed store, hash-verified

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;

Callers 2

AutoScroll.jsFile · 0.90
Sortable.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…