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