co-event
Return any event that an emitter emits
Last updated 6 years ago by tjholowaychuk .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ 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

Current Tags

  • 0.1.0                                ...           latest (6 years ago)

2 Versions

  • 0.1.0                                ...           6 years ago
  • 0.0.1                                ...           6 years ago

Copyright 2014 - 2017 © taobao.org |