JSPM

emit-function

0.0.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 42761
  • Score
    100M100P100Q150223F
  • License MIT

because i get tired of typing EE.prototype.emit.bind.bind(EE.prototype.emit)

Package Exports

  • emit-function

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (emit-function) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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