function to get firstEvent from multiple events and emiiters #7423
Replies: 1 comment
-
Improving the TypeScript types is a bit difficult. You basically have to look into piggybacking on the EventMaps that are provided in Performance wise, there's nothing there that I'd consider a red flag for performance unless you're creating that In general events like what you're dealing with in the example aren't going to be spammy enough that you need to micro-optimize there, and once the |
Beta Was this translation helpful? Give feedback.
-
I am trying to write a function to listen multiple event by different emitters and can be of kind EventTarget, NodeEmiiter and respond with which ever emit first
example
it works well and collected by gcc if any of event fire,
is there way to improve typescript types and performance?
Beta Was this translation helpful? Give feedback.
All reactions