cryptpad/lib/once.js
2019-04-11 10:54:00 +02:00

8 lines
200 B
JavaScript

module.exports = function (f) {
var called;
return function () {
if (called) { return; }
called = true;
f.apply(this, Array.prototype.slice.call(arguments));
};
};