MCPcopy Index your code
hub / github.com/TruthHun/BookStack / once

Function once

static/vuejs/vue.runtime.esm.js:238–246  ·  view source on GitHub ↗

* Ensure a function is called only once.

(fn)

Source from the content-addressed store, hash-verified

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

Callers 2

enterFunction · 0.70
leaveFunction · 0.70

Calls 1

fnFunction · 0.70

Tested by

no test coverage detected