co-event
Return any event that an emitter emits
Last updated 3 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 0
This Month 18
Last Day 1
Last Week 9
Last Month 15
Dependencies (0)
None
Dev Dependencies (3)

Copyright 2014 - 2017 © taobao.org |