MCPcopy
hub / github.com/GrapesJS/grapesjs / throttle

Function throttle

packages/core/src/utils/ColorPicker.ts:1181–1193  ·  view source on GitHub ↗
(func, wait, debounce)

Source from the content-addressed store, hash-verified

1179 }
1180
1181 function throttle(func, wait, debounce) {
1182 var timeout;
1183 return function () {
1184 var context = this,
1185 args = arguments;
1186 var throttler = function () {
1187 timeout = null;
1188 func.apply(context, args);
1189 };
1190 if (debounce) clearTimeout(timeout);
1191 if (debounce || !timeout) timeout = setTimeout(throttler, wait);
1192 };
1193 }
1194
1195 function inputTypeColorSupport() {
1196 return $.fn.spectrum.inputTypeColorSupport();

Callers 1

spectrumFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected