jcayzacJ
Deno3y ago
4 replies
jcayzac

Migrating from EventEmitter…

Hi! I've got some legacy code that depends on node:events 's EventEmitter class, specifically its once() method that returns a promise resolving the next time a specific event arrives, as well as removeAllListeners(). What would you suggest I use to get rid of that dependency? I can't use EventTarget since it doesn't let you drop all the registered listeners and doesn't support the once() scenario. Anything else?
Was this page helpful?