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

Better typings for promise.race based on conditional types #31117

Merged
merged 1 commit into from
Apr 30, 2019

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
@DanielRosenwasser DanielRosenwasser changed the title Better typings for promise.race based on mapped tuple types Better typings for promise.race based on conditional types Apr 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

let a = Promise.race([
    Promise.resolve(10),
    Promise.resolve("hello")
]);

@dubzzz
Copy link

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

@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.

@RyanCavanaugh RyanCavanaugh self-assigned this Apr 30, 2019
@RyanCavanaugh RyanCavanaugh merged commit d102ec0 into microsoft:master Apr 30, 2019
@RyanCavanaugh RyanCavanaugh 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
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 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
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants