diff options
Diffstat (limited to 'lib/internal/once.js')
-rw-r--r-- | lib/internal/once.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/internal/once.js b/lib/internal/once.js index 1293d5e..10ab26b 100644 --- a/lib/internal/once.js +++ b/lib/internal/once.js @@ -1,8 +1,10 @@ export default function once(fn) { - return function (...args) { + function wrapper (...args) { if (fn === null) return; var callFn = fn; fn = null; callFn.apply(this, args); - }; + } + Object.assign(wrapper, fn) + return wrapper } |