When should I use EventEmitter?

Technology CommunityCategory: Node.jsWhen should I use EventEmitter?
VietMX Staff asked 3 years ago

Whenever it makes sense for code to subscribe to something rather than get a callback from something. The typical use case would be that there’s multiple blocks of code in your application that may need to do something when an event happens.