delayed.js 215 Bytes Raw Blame History Permalink 1 2 3 4 5 6 7 8 9 10 11 module.exports = function delayed(amount, fn) { if (!fn) { fn = amount amount = 0 } return function() { var self = this var args = arguments setTimeout(function() { fn.apply(self, args) }, amount) } }