-
Notifications
You must be signed in to change notification settings - Fork 780
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
fix: update MailService constructor property definition in TypeScript declaration #921
Conversation
Before, `{MailService: MailService}` suggested an instance of `MailService` was being passed. Changing the syntax to `{new(): MailService}` suggests that it's a callable constructor reference available as a property
Do you mind giving this one a quick look? Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, however I believe you can also use typeof MailService
to more correctly reflect the fact that the property is actually exposing the full (uninstantiated) type.
Use `typeof MailService` over `{new (): MailService}` to indicate constructor reference
@spartan563 you're right; made the change to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thanks Daniel.
@thinkingserious any reason this wasn't merged? This is forcing us to use ugly hacks anywhere we need to create a new instance of that class. |
389fa8c
to
37473ad
Compare
Hello @dhritzkiv, |
Before,
{MailService: MailService}
suggested an instance ofMailService
was being passed. Changing the syntax to{new(): MailService}
typeof MailService
suggests that it's a callable constructor reference available as a propertyFixes
Checklist
Short description of what this PR does:
If you have questions, please send an email to SendGrid, or file a Github Issue in this repository.