Nucleus Powered Mitochondria
Miss any of our Open RFC calls?Watch the recordings here! »

co-event

0.1.0 • Public • Published

co-event

Return any event that an emitter emits.

Installation

$ npm install co-event

Example

Returns events in sequence, with the .type and .args keys. The original events are still emitted except for "error", as node will think no handler is registered.

var event = require('co-event');
 
var e;
while (= yield event(emitter)) {
  switch (e.type) {
    case 'end':
      break;
 
    case 'close':
      break;
 
    case 'error':
      break;
  }
}

License

MIT

Install

npm i co-event

DownloadsWeekly Downloads

569

Version

0.1.0

License

MIT

Last publish

Collaborators

  • avatar