GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||
GeezerVison is showing github.com — feat(lib/es2020): Add `Promise.allSettled(…)` by ExE-Boss · Pull Request #34065 · microsoft/TypeScript Conversation
| ||||||||||||||||||||||||||
|
LGTM |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I guess this code can be simplified similarly to #33707 ? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Nope, typings for node still need to support 2.1 until further notice. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I first need #33707 to be merged, so that I can get access to the |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
| * @param values An array of Promises. | ||
| * @returns A new Promise. | ||
| */ | ||
| allSettled<T extends readonly any[] | readonly [any]>(values: T): Promise<{ -readonly [P in keyof T]: PromiseSettledResult<T[P] extends PromiseLike<infer U> ? U : T[P]> }>; |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Should we make these readonly unknown[] | readonly [unknown]? (Ryan Cavanaugh (@RyanCavanaugh) Ron Buckton (@rbuckton))
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| @@ -0,0 +1,29 @@ | |||
| interface PromiseResolvedResult<T> { | |||
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Hi. Drive-by code review here. Shouldn’t this be named something like PromiseFulfilledResult to adhere to the states and fates terminology? I think the reason calling it PromiseResolvedResult is incorrect here is that while all fulfilled promises are resolved, not all resolved promises are fulfilled. A promise can be resolved to a pending promise, in which case it has not settled, and it can also be resolved to a rejected promise, in which case it has not fulfilled.
If my interpretation of states and fates terminology is correct, shouldn’t the correct name of this interface be PromiseFulfilledResult?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
ec3628c to
2929aad
Compare
|
Thank you! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Still feel like it should've used |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
LGTM |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
proposal-promise-allSettled
There was an error while loading. Please reload this page.