Today we will tackle one of those challenges, naming things.
- On the Web, we have the EventTarget class.
- And in Node, we have the [EventEmitter](https://nodejs.org/api/events.html#events_class_eventemitter] class.
Personally, I like
EventTarget because it explains that this is an object than can be the target of an event, whether or not the source of that event came from itself or not. It very quietly shows that
CustomEvent exist all without saying anything.
On the other hand I recently Jake Archibald on the HTTP 203 podcast that he prefers the
EventEmitter because is shows where the events are coming from.
The Web is backwards compatible if anything, but discourse is always fun to enlighten and help the future, so what are your thoughts? Which do you think is more effective at explaining its purpose?
Top comments (0)