mirror of https://github.com/xwiki-labs/cryptpad
update lib/once.js to match clientside definition
This commit is contained in:
parent
40f302d002
commit
a3eff2728e
|
@ -1,8 +1,7 @@
|
|||
module.exports = function (f) {
|
||||
var called;
|
||||
module.exports = function (f, g) {
|
||||
return function () {
|
||||
if (called) { return; }
|
||||
called = true;
|
||||
if (!f) { return; }
|
||||
f.apply(this, Array.prototype.slice.call(arguments));
|
||||
f = g;
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue