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

[TypeDefinition] SendGrid.API should return Promise<T> instead of PromiseLike<T> #333

Merged
merged 1 commit into from
Mar 10, 2017

Conversation

IOAyman
Copy link
Contributor

@IOAyman IOAyman commented Oct 31, 2016

Issue Summary

I think the SendGrid.API function should return a object on which either .then() or .catch() can be called upon.

The current implementation uses PromiseLike interface which only ensures .then().
But the problem would be solved by using Promise interface instead.

Demo

SendGridClient
    .API(request)
    .then(okFunction)
    .catch(noOkFunction)  // this line will not be reported as an error anymore

Technical details:

  • sendgrid-nodejs Version: master (latest commit: [https://github.com/sendgrid/sendgrid-nodejs/commit/d01e7ef])
  • Node.js Version: 6.9.1
  • TypeScript Version: 2.0.3

This references #308
/cc @spartan563

@notheotherben
Copy link
Contributor

👍 Looks good to me

@heitortsergent
Copy link
Contributor

:shipit:

@thinkingserious thinkingserious added type: community enhancement feature request not on Twilio's roadmap status: cla needed status: work in progress Twilio or the community is in the process of implementing labels Nov 8, 2016
@thinkingserious
Copy link
Contributor

Hello @IOAyman!

Thanks for the PR, great work :)

Could you please sign our CLA so that we can merge it?

@IOAyman
Copy link
Contributor Author

IOAyman commented Jan 1, 2017

@thinkingserious I sent an email on Nov.11.2016 asking a question but no response.

@thinkingserious
Copy link
Contributor

@IOAyman,

My apologies, looks like I sent it to the wrong email address (facepalm)

I have now forwarded my response.

@thinkingserious thinkingserious added status: cla signed status: code review request requesting a community code review or review from Twilio and removed status: cla needed status: work in progress Twilio or the community is in the process of implementing labels Jan 27, 2017
@ksiegel
Copy link

ksiegel commented Feb 22, 2017

Hey folks! Running into this issue myself. Hopefully y'all are emailing back and forth to get this merged.

as Promise<any> for now! 😃

@thinkingserious
Copy link
Contributor

Hi @ksiegel,

This one is still climbing up our backlog. I've now added your vote to bump it up further, thanks!

@thinkingserious thinkingserious merged commit bd1c4c4 into sendgrid:master Mar 10, 2017
@IOAyman IOAyman deleted the path-typedefinition branch March 10, 2017 19:57
@thinkingserious
Copy link
Contributor

Thanks again @IOAyman!

Please take a moment to fill out this form so that we can send you some swag :)

@IOAyman
Copy link
Contributor Author

IOAyman commented Mar 10, 2017

Very much appreciated, thank you 🎆 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: code review request requesting a community code review or review from Twilio type: community enhancement feature request not on Twilio's roadmap
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants