MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / delayed

Function delayed

lib/web/jshint.js:9183–9201  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

9181 }
9182
9183 function delayed() {
9184 var remaining = wait - (now() - stamp);
9185 if (remaining <= 0 || remaining > wait) {
9186 if (maxTimeoutId) {
9187 clearTimeout(maxTimeoutId);
9188 }
9189 var isCalled = trailingCall;
9190 maxTimeoutId = timeoutId = trailingCall = undefined;
9191 if (isCalled) {
9192 lastCalled = now();
9193 result = func.apply(thisArg, args);
9194 if (!timeoutId && !maxTimeoutId) {
9195 args = thisArg = null;
9196 }
9197 }
9198 } else {
9199 timeoutId = setTimeout(delayed, remaining);
9200 }
9201 }
9202
9203 function maxDelayed() {
9204 if (timeoutId) {

Callers

nothing calls this directly

Calls 2

nowFunction · 0.85
applyMethod · 0.65

Tested by

no test coverage detected