Skip to content
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

Allow async listeners in the TypeScript types #70

Merged
merged 2 commits into from
Dec 29, 2020

Conversation

airhorns
Copy link
Contributor

This is on top of #69.

Emittery already supports awaiting event emission, which in turn awaits all the listeners that return a Promise. If a caller awaits emit, all the listeners will have resolved by the time the outer promise resolves, which is great!

This adds a test for that behaviour, and updates the TypeScript types to support these async listeners. There's no new or changed behaviour.

@sindresorhus
Copy link
Owner

Can you fix the merge conflict?

Emittery already supports awaiting event emission, which in turn awaits all the listeners that return a Promise. If a caller awaits `emit`, all the listeners will have resolved by the time the outer promise resolves, which is great!

This adds a test for that behaviour, and updates the TypeScript types to support these async listeners. There's no new or changed behaviour.
index.d.ts Outdated Show resolved Hide resolved
Co-authored-by: Sindre Sorhus <[email protected]>
@sindresorhus sindresorhus merged commit 7db4644 into sindresorhus:master Dec 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants