-
-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
types: change Awaitable<void> to void #10017
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
This is a normal pattern, and TypeScript explicitly supports it with the standard |
async_event_emitter returns |
No it doesn't, it uses |
Oh, my bad, I was looking at the Listener type instead of the type used in on(…) assuming it was used there… |
Please describe the changes this PR makes and why it should be merged:
Currently, event listeners require a function that returns
Awaitable<void>
. However, this prevents returning a function call that returns a value for early execution (e.g.return interaction.reply('error')
). This PR changes=> Awaitable<void>
to=> void
, since void functions can return anything. This will remove the restriction and allow any function, bringing it in line with Node's standard EventEmitters, as well as previous discord.js behavior.Status and versioning classification: