Closed feross closed 3 years ago
Nevermind, this is dependent on first implementing events.on
. See: https://github.com/browserify/events/issues/76
@feross would it help if Node just vendored events
independently (like readable stream)?
It looks like events.js doesn't actually have any non-constant dependencies (other than event_target which is also pretty easy to fix)
@benjamingr Part of the goal of this package is also to be compatible with old browsers (except for the Promise functions). If events
could be vendored independently and compiled down for browsers just like readable-stream is, I think that would be amazing :)
Opened https://github.com/nodejs/node/issues/37435 - let me know if this is something you'd like to collaborate on.
It's basically a script that "rips out" events
from Node's lib folder and shims core-related things (not many)
An
AbortSignal
can be used to cancel waiting on events. See: https://nodejs.org/api/events.html#events_events_on_emitter_eventname_options