10 lines
173 B
JavaScript
10 lines
173 B
JavaScript
|
'use strict';
|
||
|
|
||
|
module.exports = function once(fn) {
|
||
|
return function() {
|
||
|
if (fn === null) return;
|
||
|
fn.apply(this, arguments);
|
||
|
fn = null;
|
||
|
};
|
||
|
};
|