Giter VIP home page Giter VIP logo

co-event's Introduction

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

co-event's People

Contributors

tj avatar

Stargazers

 avatar 曹文忠 avatar Joaquim Serafim avatar Fabian Eichenberger avatar Marc Knaup avatar Po-Ying Chen avatar Jesse Yang avatar 迁移到 leogiese avatar Pana avatar Ju avatar  avatar James Spencer avatar Julian Gruber avatar Phips Peter avatar

Watchers

Julian Gruber avatar  avatar Prakash Durgani avatar david birdsong avatar James Cloos avatar Achille avatar Andrius Vaskys avatar Julien Fabre avatar George Wolf avatar Rakesh Nair avatar  avatar Gurdas Nijor avatar  avatar Karthick Sriraman avatar  avatar Niels avatar  avatar Sam Johnson avatar  avatar  avatar Sherry Chao avatar Jenn Boyce avatar Michael Phillips avatar Christopher Albanese avatar Brent Summers avatar Alex Noonan avatar Teresa Nesteby avatar Chris Nixon avatar  avatar  avatar Zeb avatar Liz Hartmann avatar Arlen McCluskey avatar  avatar Ian Muceus avatar  avatar Emilio Gomez Lavin avatar  avatar Kate Flaming avatar  avatar

co-event's Issues

return array

with .type would be a lot nicer, but people seem really confused when you have an array that also has properties... this would be cool for ES6 restructuring too, [type, arg...]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.