Better typings for promise.race based on conditional types#31117
Merged
RyanCavanaugh merged 1 commit intomicrosoft:masterfrom Apr 30, 2019
Merged
Better typings for promise.race based on conditional types#31117RyanCavanaugh merged 1 commit intomicrosoft:masterfrom
RyanCavanaugh merged 1 commit intomicrosoft:masterfrom
Conversation
Following the feature - Mapped tuple types microsoft#25947 - it is now possible to have better typings for Promise.race
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 let a = Promise.race([
Promise.resolve(10),
Promise.resolve("hello")
]); |
|
@DanielRosenwasser You're right. I think my first commit was really using mapped types but I changed it following reviews 🤔 |
Member
Author
|
@typescript-bot test this |
Collaborator
|
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. |
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
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
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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