From Dev.to
Build a tiny event emitter in 50 lines (and the one bug most versions have)
Event emitters are everywhere: Node's EventEmitter, the DOM's addEventListener, every state library you've used. Writing one yourself takes about fifty lines, and it's a great exercise because there's...
