Adding onEach, support for EventEmitters #111

Closed
wants to merge 1 commit into
from

Projects

None yet

2 participants

@evanderkoogh

I have added a method onEach that takes a couple of parameters to ease working with events.
I have to do a lot of parsing of cvs and xml files and most streaming libraries use events for this.

Internally is registers some events on the emitters and then uses a queue internally to keep track of work.
I have added some tests and some documentation.

Normally I do my programming in Coffeescript in Node, so I might not be aware of some Javascript conventions. This is also my first github pull request, so the same goes for that.

As for my code, there are 2 things I do not like.

  • I think like the number of arguments, but I can't think of a good way to make it less
  • Internally I use JSON.stringify and JSON.parse, because whenqueue.push sees an Array it assumes there are multiple tasks. Also here I can't find a good way to work around this.
@caolan
Owner
caolan commented Mar 28, 2014

I don't think we should get into handling data from event emitters

@caolan caolan closed this Mar 28, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment