emit-function
because i get tired of typing EE.prototype.emit.bind.bind(EE.prototype.emit)
Last updated 12 years ago by chrisdickinson .
MIT · Original npm · Tarball · package.json
$ npm install emit-function 
SYNC missed versions from official npm registry.

emit-function

because I hate having to import EventEmitter and call EventEmitter.prototype.emit.bind.bind(EventEmitter.prototype.emit).


var EE = require('events').EventEmitter
  , emit = require('emit-function')

var ee_1 = new EE
  , ee_2 = new EE

ee_1.on('data', emit(ee_2, 'data'))

api

emit(eventemitter, eventName[, curryArg1...curryArgN]) -> function

Creates a function that, when called, calls emit on eventemitter with eventName. Curried args are placed at the front, args added by calling the function are added after the curried args. Allows easy forwarding of events from emitter to emitter.

license

MIT

Current Tags

  • 0.0.2                                ...           latest (12 years ago)

3 Versions

  • 0.0.2                                ...           12 years ago
  • 0.0.1                                ...           12 years ago
  • 0.0.0                                ...           12 years ago
Maintainers (1)
Downloads
Total 3
Today 1
This Week 1
This Month 1
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE