From a3eff2728e80d260c692aa4ec6b9db8b6683622a Mon Sep 17 00:00:00 2001 From: ansuz Date: Mon, 9 Sep 2019 16:39:54 +0200 Subject: [PATCH] update lib/once.js to match clientside definition --- lib/once.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/once.js b/lib/once.js index 369ee162e..a851af259 100644 --- a/lib/once.js +++ b/lib/once.js @@ -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; }; };