Understanding Event Emitters
Consider, a DOM Event:
const button = document.querySelector("button");
button.addEventListener("click", (event) =/* do something with the event */)
We added a listener to a button click. We’ve subscribed to an event being emitted and we fire a callback when it …