co-event
Return any event that an emitter emits
Last updated 8 years ago .
· 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 (8 years ago)

2 Versions

  • 0.0.1                                ...           8 years ago
  • 0.1.0                                ...           8 years ago
Maintainers (1)
Dependencies (0)
None
Dev Dependencies (3)

Copyright © npmmirror.com | 浙ICP备15033595号-63 |