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

Function once

static/vuejs/vue.runtime.common.js:240–248  ·  view source on GitHub ↗

* Ensure a function is called only once.

(fn)

Source from the content-addressed store, hash-verified

238 * Ensure a function is called only once.
239 */
240function once (fn) {
241 var called = false;
242 return function () {
243 if (!called) {
244 called = true;
245 fn();
246 }
247 }
248}
249
250/* */
251

Callers 2

enterFunction · 0.70
leaveFunction · 0.70

Calls 1

fnFunction · 0.70

Tested by

no test coverage detected