{"action":"created","issue":{"url":"https://api.github.com/repos/jasonwilliams/proposal-promise-allSettled/issues/7","repository_url":"https://api.github.com/repos/jasonwilliams/proposal-promise-allSettled","labels_url":"https://api.github.com/repos/jasonwilliams/proposal-promise-allSettled/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/jasonwilliams/proposal-promise-allSettled/issues/7/comments","events_url":"https://api.github.com/repos/jasonwilliams/proposal-promise-allSettled/issues/7/events","html_url":"https://github.com/jasonwilliams/proposal-promise-allSettled/issues/7","id":350165363,"node_id":"MDU6SXNzdWUzNTAxNjUzNjM=","number":7,"title":"Behavior with all \"settled\" promises as rejected","user":{"login":"getify","id":150330,"node_id":"MDQ6VXNlcjE1MDMzMA==","avatar_url":"https://avatars1.githubusercontent.com/u/150330?v=4","gravatar_id":"","url":"https://api.github.com/users/getify","html_url":"https://github.com/getify","followers_url":"https://api.github.com/users/getify/followers","following_url":"https://api.github.com/users/getify/following{/other_user}","gists_url":"https://api.github.com/users/getify/gists{/gist_id}","starred_url":"https://api.github.com/users/getify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/getify/subscriptions","organizations_url":"https://api.github.com/users/getify/orgs","repos_url":"https://api.github.com/users/getify/repos","events_url":"https://api.github.com/users/getify/events{/privacy}","received_events_url":"https://api.github.com/users/getify/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":18,"created_at":"2018-08-13T19:40:36Z","updated_at":"2018-09-06T01:06:46Z","closed_at":"2018-09-05T22:10:14Z","author_association":"NONE","body":"If I'm understanding the proposal correctly, all input promises being rejected still results in a fulfilled promise, correct?\r\n\r\nI think that's going to create some confusion in the community. Paving over all rejections and turning them into a fulfillment, regardless of the use-cases you may want that, I think is troublesome to teach and get your head around. Also, if I want to answer \"were they all rejected?\", I think the only way is to manually iterate all the results, right?\r\n\r\nBut I also understand why the short-circuting of `Promise.all(..)` to a rejected promise, as soon as  any single rejection is encountered, is not helpful, either.\r\n\r\nI think there's a tweak to this proposed behavior that will make more sense, allow better ergonomics in case of need to distinguish, and still provide the same facility as is desired here.\r\n\r\nI suggest, in the case of all rejections, this method's promise actually resolves to **rejected**, again with an array of all results. That way, the mental model is, \"if *any* results are fulfilled, you know that by a fulfilled promise\" and \"if *all* results are rejected, you know that by a rejected promise\". IOW, you can easily distinguish those two cases.\r\n\r\nIn the case where you don't want to distinguish, and only care about \"all resolved no matter what\", then you can just use `finally(..)` instead of `then(..)`, and you get that desired result."},"comment":{"url":"https://api.github.com/repos/jasonwilliams/proposal-promise-allSettled/issues/comments/418930160","html_url":"https://github.com/jasonwilliams/proposal-promise-allSettled/issues/7#issuecomment-418930160","issue_url":"https://api.github.com/repos/jasonwilliams/proposal-promise-allSettled/issues/7","id":418930160,"node_id":"MDEyOklzc3VlQ29tbWVudDQxODkzMDE2MA==","user":{"login":"ljharb","id":45469,"node_id":"MDQ6VXNlcjQ1NDY5","avatar_url":"https://avatars1.githubusercontent.com/u/45469?v=4","gravatar_id":"","url":"https://api.github.com/users/ljharb","html_url":"https://github.com/ljharb","followers_url":"https://api.github.com/users/ljharb/followers","following_url":"https://api.github.com/users/ljharb/following{/other_user}","gists_url":"https://api.github.com/users/ljharb/gists{/gist_id}","starred_url":"https://api.github.com/users/ljharb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ljharb/subscriptions","organizations_url":"https://api.github.com/users/ljharb/orgs","repos_url":"https://api.github.com/users/ljharb/repos","events_url":"https://api.github.com/users/ljharb/events{/privacy}","received_events_url":"https://api.github.com/users/ljharb/received_events","type":"User","site_admin":false},"created_at":"2018-09-06T01:06:46Z","updated_at":"2018-09-06T01:06:46Z","author_association":"NONE","body":"In either case (where it can produce a rejection) if you want to distinguish some rejected vs all rejected, you have to do iteration for one of the cases. In the case where it never rejects, you always have to iterate. You’ve made a pretty good argument i think for “it can reject”, but imo the stronger case there is for “it rejects when any reject”, like Promise.all."}}
{"actor":{"display_login":"ljharb"}}