-
-
Notifications
You must be signed in to change notification settings - Fork 543
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
Proposal: Promisable #40
Comments
I'd be happy to integrate this. |
This could also be quite nice for Promise.all style arguments. |
Accepted on the condition that someone opens an issue on TypeScript requesting it be added as a built-in, and comments the link to the issue here. I think it's a very common need. For anyone that wants to tackle this, please read guide for adding a type and also see how the last type was added: 22c3a99 (Note the extensive docs and comments). |
Edit: there was already an issue about this: microsoft/TypeScript#31394 |
Some times we are just awaiting a function, so we don't really care if the returned value is actually a promise or not. With
Promisable
:One could write this:
Rather than:
It helps write a bit cleaner code. I'm not sure if it's useful enough to be included here, but I thought I'd mention it.
Upvote & Fund
The text was updated successfully, but these errors were encountered: