RubenVerborgh / AsyncIterator

An asynchronous iterator library for advanced object pipelines in JavaScript
https://rubenverborgh.github.io/AsyncIterator/docs/
Other
46 stars 7 forks source link

Migrate to use a different event emitter base #90

Open jeswr opened 2 years ago

jeswr commented 2 years ago

While we are doing a semver upgrade we may also want to migrate to use https://www.npmjs.com/package/eventemitter3 which appears to be a much less bloated; and more optimised version over the EventEmitter compared to what I've seen in the NodeJS core.

RubenVerborgh commented 2 years ago

I'm interested, although:

  • We do not throw an error when you emit an error event and nobody is listening.

  • The newListener and removeListener events have been removed as they are useful only in some uncommon use-cases.

But we can get around these limitations.

Just a note that AsyncIterator might be bundled together with other Node.js code, which would use the native EventEmitter, so it's not certain that we would remove bloat. But happy to give it a go.

jacoscaz commented 1 year ago

Just FYI and for when the time comes, I can easily run a few tests by forcing the build of quadstore-comunica to use eventemitter3 instead of events.