diff --git a/lib/once.js b/lib/once.js new file mode 100644 index 000000000..369ee162e --- /dev/null +++ b/lib/once.js @@ -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)); + }; +};