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

Function once

static/vuejs/vue.runtime.js:244–252  ·  view source on GitHub ↗

* Ensure a function is called only once.

(fn)

Source from the content-addressed store, hash-verified

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

Callers 2

enterFunction · 0.70
leaveFunction · 0.70

Calls 1

fnFunction · 0.70

Tested by

no test coverage detected