co-event
Return any event that an emitter emits
Last updated 4 years ago by tjholowaychuk .
MIT · Repository · Bugs · Original npm · Tarball
$ cnpm install co-event 
SYNC missed versions from official npm registry.

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 (e = yield event(emitter)) {
  switch (e.type) {
    case 'end':
      break;

    case 'close':
      break;

    case 'error':
      break;
  }
}

License

MIT

Maintainers (1)
Downloads
Today 0
This Week 11
This Month 43
Last Day 1
Last Week 18
Last Month 35
Dependencies (0)
None
Dev Dependencies (3)

Copyright 2014 - 2016 © taobao.org |