MCPcopy Create free account
hub / github.com/TruthHun/BookStack / once

Function once

static/vuejs/vue.js:248–256  ·  view source on GitHub ↗

* Ensure a function is called only once.

(fn)

Source from the content-addressed store, hash-verified

246 * Ensure a function is called only once.
247 */
248function once (fn) {
249 var called = false;
250 return function () {
251 if (!called) {
252 called = true;
253 fn();
254 }
255 }
256}
257
258/* */
259

Callers 2

enterFunction · 0.70
leaveFunction · 0.70

Calls 1

fnFunction · 0.70

Tested by

no test coverage detected