Synchronously invoke every listener registered for event. Errors
thrown by individual listeners are swallowed and routed back into
the "error" channel (if any) so one bad listener can't take down
the rest of the chain.
Remove every listener for every event.
Generic typed event emitter. The
Eventstype parameter is a map from event name to the callback signature; this lets consumers get full IntelliSense for bothon()andemit().Example