Skip to content

Conversation

@RyanCavanaugh
Copy link
Member

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

Following the feature - Mapped tuple types microsoft#25947 - it is now possible to have better typings for Promise.race
@DanielRosenwasserDanielRosenwasser changed the title Better typings for promise.race based on mapped tuple typesBetter typings for promise.race based on conditional typesApr 25, 2019
@DanielRosenwasser
Copy link
Member

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
Copy link

@DanielRosenwasser You're right. I think my first commit was really using mapped types but I changed it following reviews 🤔

@RyanCavanaugh
Copy link
MemberAuthor

@typescript-bot test this

@typescript-bot
Copy link
Collaborator

typescript-bot commented Apr 30, 2019

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.

@RyanCavanaughRyanCavanaugh self-assigned this Apr 30, 2019
@RyanCavanaughRyanCavanaugh merged commit d102ec0 into microsoft:masterApr 30, 2019
@RyanCavanaughRyanCavanaugh deleted the dubzzz_port branch April 30, 2019 16:23
jablko added a commit to jablko/TypeScript that referenced this pull request Aug 23, 2019
jablko added a commit to jablko/TypeScript that referenced this pull request Aug 23, 2019
jablko added a commit to jablko/TypeScript that referenced this pull request Aug 23, 2019
jablko added a commit to jablko/TypeScript that referenced this pull request Aug 23, 2019
jablko added a commit to jablko/TypeScript that referenced this pull request Aug 23, 2019
jablko added a commit to jablko/TypeScript that referenced this pull request Aug 23, 2019
jablko added a commit to jablko/TypeScript that referenced this pull request Aug 25, 2019
jablko added a commit to jablko/TypeScript that referenced this pull request Aug 25, 2019
jablko added a commit to jablko/TypeScript that referenced this pull request Aug 25, 2019
jablko added a commit to jablko/TypeScript that referenced this pull request Aug 25, 2019
jablko added a commit to jablko/TypeScript that referenced this pull request Aug 25, 2019
jablko added a commit to jablko/TypeScript that referenced this pull request Aug 25, 2019
jablko added a commit to jablko/TypeScript that referenced this pull request Aug 27, 2019
jablko added a commit to jablko/TypeScript that referenced this pull request Aug 27, 2019
jablko added a commit to jablko/TypeScript that referenced this pull request Aug 27, 2019
jablko added a commit to jablko/TypeScript that referenced this pull request Aug 27, 2019
jablko added a commit to jablko/TypeScript that referenced this pull request Aug 27, 2019
jablko added a commit to jablko/TypeScript that referenced this pull request Aug 27, 2019
jablko added a commit to jablko/TypeScript that referenced this pull request Aug 29, 2019
jablko added a commit to jablko/TypeScript that referenced this pull request Aug 29, 2019
jablko added a commit to jablko/TypeScript that referenced this pull request Feb 12, 2020
jablko added a commit to jablko/TypeScript that referenced this pull request Feb 12, 2020
jablko added a commit to jablko/TypeScript that referenced this pull request Feb 13, 2020
jablko added a commit to jablko/TypeScript that referenced this pull request Feb 13, 2020
You can include es2015.promise.d.ts without es2015.iterable.d.ts. It was moved to es2015.promise.d.ts in microsoft#31117
jablko added a commit to jablko/TypeScript that referenced this pull request Feb 13, 2020
jablko added a commit to jablko/TypeScript that referenced this pull request Feb 13, 2020
jablko added a commit to jablko/TypeScript that referenced this pull request Feb 13, 2020
You can include es2015.promise.d.ts without es2015.iterable.d.ts. It was moved to es2015.promise.d.ts in microsoft#31117
jablko added a commit to jablko/TypeScript that referenced this pull request Feb 13, 2020
You can include es2015.promise.d.ts without es2015.iterable.d.ts. It was moved to es2015.promise.d.ts in microsoft#31117
jablko added a commit to jablko/TypeScript that referenced this pull request Feb 13, 2020
jablko added a commit to jablko/TypeScript that referenced this pull request Feb 21, 2020
jablko added a commit to jablko/TypeScript that referenced this pull request Feb 21, 2020
jablko added a commit to jablko/TypeScript that referenced this pull request Feb 21, 2020
You can include es2015.promise.d.ts without es2015.iterable.d.ts. It was moved to es2015.promise.d.ts in microsoft#31117
jablko added a commit to jablko/TypeScript that referenced this pull request Feb 21, 2020
jablko added a commit to jablko/TypeScript that referenced this pull request Feb 21, 2020
You can include es2015.promise.d.ts without es2015.iterable.d.ts. It was moved to es2015.promise.d.ts in microsoft#31117
jablko added a commit to jablko/TypeScript that referenced this pull request Feb 21, 2020
jablko added a commit to jablko/TypeScript that referenced this pull request Feb 21, 2020
You can include es2015.promise.d.ts without es2015.iterable.d.ts. It was moved to es2015.promise.d.ts in microsoft#31117
jablko added a commit to jablko/TypeScript that referenced this pull request Feb 22, 2020
You can include es2015.promise.d.ts without es2015.iterable.d.ts. It was moved to es2015.promise.d.ts in microsoft#31117
jablko added a commit to jablko/TypeScript that referenced this pull request Feb 22, 2020
jablko added a commit to jablko/TypeScript that referenced this pull request Feb 22, 2020
jablko added a commit to jablko/TypeScript that referenced this pull request Feb 22, 2020
You can include es2015.promise.d.ts without es2015.iterable.d.ts. It was moved to es2015.promise.d.ts in microsoft#31117
jablko added a commit to jablko/TypeScript that referenced this pull request Feb 22, 2020
You can include es2015.promise.d.ts without es2015.iterable.d.ts. It was moved to es2015.promise.d.ts in microsoft#31117
jablko added a commit to jablko/TypeScript that referenced this pull request Feb 22, 2020
jablko added a commit to jablko/TypeScript that referenced this pull request Feb 22, 2020
@dubzzzdubzzz mentioned this pull request Jun 13, 2020
rbuckton pushed a commit to jablko/TypeScript that referenced this pull request Mar 18, 2022
rbuckton added a commit that referenced this pull request Aug 2, 2022
* Better typings for Promise.resolve(), like #31117 * Add tests * Update to Awaited<T> * Fix issue with Awaited affecting jQuery, additional tests Co-authored-by: Ron Buckton <ron.buckton@microsoft.com>
sandersn added a commit that referenced this pull request Aug 8, 2022
typescript-bot pushed a commit to typescript-bot/TypeScript that referenced this pull request Aug 9, 2022
Component commits: c28ee65 Revert "Better typings for Promise.resolve(), like microsoft#31117 (microsoft#33074)" This reverts commit 040c121.
typescript-bot pushed a commit to typescript-bot/TypeScript that referenced this pull request Aug 11, 2022
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>
@microsoftmicrosoft locked as resolved and limited conversation to collaborators Oct 21, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@RyanCavanaugh@DanielRosenwasser@dubzzz@typescript-bot@buu700