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

Function once

static/vuejs/vue.esm.js:242–250  ·  view source on GitHub ↗

* Ensure a function is called only once.

(fn)

Source from the content-addressed store, hash-verified

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

Callers 2

enterFunction · 0.70
leaveFunction · 0.70

Calls 1

fnFunction · 0.70

Tested by

no test coverage detected