- Notifications
You must be signed in to change notification settings - Fork 13.2k
Better typings for promise.race based on conditional types#31117
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
Uh oh!
There was an error while loading. Please reload this page.
Conversation
Following the feature - Mapped tuple types microsoft#25947 - it is now possible to have better typings for Promise.race
DanielRosenwasser commented Apr 25, 2019
This is thanks to conditional types, not mapped types. It'd be nice to have a test of some sort (I'm sure we don't). Something simple like leta=Promise.race([Promise.resolve(10),Promise.resolve("hello")]); |
dubzzz commented Apr 26, 2019
@DanielRosenwasser You're right. I think my first commit was really using mapped types but I changed it following reviews 🤔 |
RyanCavanaugh commented Apr 30, 2019
@typescript-bot test this |
typescript-bot commented Apr 30, 2019 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
Heya @RyanCavanaugh, I've started to run the extended test suite on this PR at 7ee4e63. You can monitor the build here. It should now contribute to this PR's status checks. |
You can include es2015.promise.d.ts without es2015.iterable.d.ts. It was moved to es2015.promise.d.ts in microsoft#31117
You can include es2015.promise.d.ts without es2015.iterable.d.ts. It was moved to es2015.promise.d.ts in microsoft#31117
You can include es2015.promise.d.ts without es2015.iterable.d.ts. It was moved to es2015.promise.d.ts in microsoft#31117
You can include es2015.promise.d.ts without es2015.iterable.d.ts. It was moved to es2015.promise.d.ts in microsoft#31117
You can include es2015.promise.d.ts without es2015.iterable.d.ts. It was moved to es2015.promise.d.ts in microsoft#31117
You can include es2015.promise.d.ts without es2015.iterable.d.ts. It was moved to es2015.promise.d.ts in microsoft#31117
You can include es2015.promise.d.ts without es2015.iterable.d.ts. It was moved to es2015.promise.d.ts in microsoft#31117
You can include es2015.promise.d.ts without es2015.iterable.d.ts. It was moved to es2015.promise.d.ts in microsoft#31117
You can include es2015.promise.d.ts without es2015.iterable.d.ts. It was moved to es2015.promise.d.ts in microsoft#31117
Component commits: c28ee65 Revert "Better typings for Promise.resolve(), like microsoft#31117 (microsoft#33074)" This reverts commit 040c121.
Component commits: c28ee65 Revert "Better typings for Promise.resolve(), like microsoft#31117 (microsoft#33074)" This reverts commit 040c121. Co-authored-by: Nathan Shively-Sanders <nathansa@microsoft.com>
Following the feature - Mapped tuple types #25947 - it is now possible to have better typings for Promise.race
From @dubzzz before I messed up his fork