Nomnom Pumpernickle Muffins
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

emit-function

0.0.2 • Public • Published

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

Keywords

none

install

npm i emit-function

Downloadsweekly downloads

788

version

0.0.2

license

none

repository

githubgithub

last publish

collaborators

  • avatar