-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Conversation
Following the feature - Mapped tuple types microsoft#25947 - it is now possible to have better typings for Promise.race
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 🤔 |
@typescript-bot test this |
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
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