Sha256: cb930ea05a5328a047c04f2af2369e5dc8d87c7b40cf002f7a32100a010882a4
Contents?: true
Size: 370 Bytes
Versions: 89
Compression:
Stored size: 370 Bytes
Contents
/** * Module exports. */ module.exports = on; /** * Helper for subscriptions. * * @param {Object|EventEmitter} obj with `Emitter` mixin or `EventEmitter` * @param {String} event name * @param {Function} callback * @api public */ function on(obj, ev, fn) { obj.on(ev, fn); return { destroy: function(){ obj.removeListener(ev, fn); } }; }
Version data entries
89 entries across 89 versions & 3 rubygems