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

Add type annotation to EventEmitter #4510

Merged
merged 1 commit into from
Jul 10, 2024

Conversation

FrederikBolding
Copy link
Member

Explanation

Adds a type annotation for the EventEmitter in AbstractMessageMessenger.

Without this, TypeScript would infer EventEmitter to be generic and break types in packages consuming this package.

    hub: EventEmitter<[never]>;

Following this change, the EventEmitter is no longer inferred as generic.

    hub: EventEmitter;

Changelog

@metamask/message-manager

  • Fixed: Fix EventEmitter inferred type

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've highlighted breaking changes using the "BREAKING" category above as appropriate

@FrederikBolding FrederikBolding requested a review from a team as a code owner July 10, 2024 08:40
@FrederikBolding FrederikBolding merged commit a806ef5 into main Jul 10, 2024
116 checks passed
@FrederikBolding FrederikBolding deleted the fb/add-type-annotation-for-event-emitter branch July 10, 2024 08:46
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