MCPcopy
hub / github.com/caolan/async / onlyOnce

Function onlyOnce

lib/internal/onlyOnce.js:1–8  ·  view source on GitHub ↗
(fn)

Source from the content-addressed store, hash-verified

1export default function onlyOnce(fn) {
2 return function() {
3 if (fn === null) throw new Error("Callback was already called.");
4 var callFn = fn;
5 fn = null;
6 callFn.apply(this, arguments);
7 };
8}

Callers 10

foreverFunction · 0.85
whilstFunction · 0.85
doWhilstFunction · 0.85
doDuringFunction · 0.85
runTaskFunction · 0.85
eachOfArrayLikeFunction · 0.85
duringFunction · 0.85
nextTaskFunction · 0.85
replenishFunction · 0.85
queueFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…