MCPcopy
hub / github.com/microsoft/SandDance / callback

Function callback

docs/app/js/sanddance-app.js:20863–20876  ·  view source on GitHub ↗
(userCall)

Source from the content-addressed store, hash-verified

20861 if (options && typeof options.leading === "boolean") leading = options.leading;
20862 if (options && typeof options.trailing === "boolean") trailing = options.trailing;
20863 var callback = function(userCall) {
20864 var now = Date.now();
20865 var delta = now - lastExecuteTime;
20866 var waitLength = leading ? waitMS - delta : waitMS;
20867 if (delta >= waitMS && (!userCall || leading)) {
20868 lastExecuteTime = now;
20869 if (timeoutId) {
20870 _this.clearTimeout(timeoutId);
20871 timeoutId = null;
20872 }
20873 lastResult = func.apply(_this._parent, lastArgs);
20874 } else if (timeoutId === null && trailing) timeoutId = _this.setTimeout(callback, waitLength);
20875 return lastResult;
20876 };
20877 // eslint-disable-next-line @typescript-eslint/no-explicit-any
20878 var resultFunction = function() {
20879 var args = [];

Callers 15

resultFunctionFunction · 0.70
mapEnumByNameFunction · 0.70
sanddance-app.jsFile · 0.70
loadThemeFunction · 0.70
notifyHostChangedFunction · 0.70
asyncCallbackFunction · 0.70
runAfterFunction · 0.70
visitPointsFunction · 0.70
stitchFunction · 0.70
tickFunction · 0.70
startTransitionFunction · 0.50

Calls 2

invokeFunctionFunction · 0.85
minMethod · 0.45

Tested by

no test coverage detected