oops
This commit is contained in:
8
lib/once.js
Normal file
8
lib/once.js
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
module.exports = function (f) {
|
||||||
|
var called;
|
||||||
|
return function () {
|
||||||
|
if (called) { return; }
|
||||||
|
called = true;
|
||||||
|
f.apply(this, Array.prototype.slice.call(arguments));
|
||||||
|
};
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user