-
Notifications
You must be signed in to change notification settings - Fork 9
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
Support for named bag of promises #28
Comments
That's a very tricky problem, and one that should be handled by a separate proposal - this is meant to be sugar for existing Promise operations. See https://github.com/ajvincent/proposal-await-dictionary for discussion of handling an object. I'll close this as out of scope, until the language already has the capability of handling a dictionary of Promises. |
Fair enough that it might be out of scope but I think it should be kept in mind otherwise it might prevent future syntax possibilities here. |
I'm not sure how it would - if Since Promise.all takes an iterable, I assume the only way it could also take an object is as an overload, which |
We do not necessarily need
As we are still in stage 1, it feels like this type of discussion on the design would be valuable. |
I think it's very critical that Promise syntax continue to never have any capabilities that Promise APIs do - iow, it's merely sugar for them. That held throughout a number of async proposals. I also think that the major value prop of this proposal's syntax is the correspondence with the static Promise combinators. I'll certainly reopen to continue discussion, since this would be a potential cross-cutting concern, but I don't foresee a different outcome. |
thanks. Even if the outcome doesn't change, at least it would be a conscious outcome rather than incidental 🙂 |
The most common frustration I hit with
Promise.all
is that it only supports lists of promises, which doesn't scale well when starting multiple discreet tasks in parallel.As the code grows and more things are added over time it can get harder to be sure that the names are lining up with the correct promise. If
await.all
had a grammar that added support for named promises I would find that very valuable.await.all [...]
for iterator andawait.all {...}
for nominal.Refs: http://bluebirdjs.com/docs/api/promise.props.html
The text was updated successfully, but these errors were encountered: