You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I could image that the array of arguments sent to event listeners is also returned:
const[foo,bar]=awaitemitter.once('done');
Re-using the once method for this would avoid introducing a new method name that could conflict with existing emitters.
Please don't focus on the listening use-case too much, it is just one example (and this is not stackoverflow). It's the code pattern that I would like to discuss.
I would love to get peoples' input on this. Is this something you would want to see too? Or not, and why not? Is there a more elegant solution you can think of? Thanks.
Activity
mscdex commentedon Oct 10, 2018
See this PR.
ronkorving commentedon Oct 10, 2018
@mscdex Oh my, how did I miss that? That's exactly what I was proposing. Thanks for sharing, I will close this issue.