In TypeScript, I wrote a tiny Node style EventEmitter with a type parameter that describes the event names that the emitter can event as well as the type of the fun
EventEmitter