once.js 198 Bytes Raw Blame History Permalink 1 2 3 4 5 6 7 8 9 10 11 12 'use strict'; module.exports = function once(fn) { let called = false; return function() { if (called) { return; } called = true; return fn.apply(null, arguments); }; };