dojo / core

:rocket: Dojo 2 - language helpers and utilities.
http://dojo.io
Other
213 stars 62 forks source link

Support some form of Promise.all(Object) #211

Closed kitsonk closed 7 years ago

kitsonk commented 7 years ago

The ES6 specification only accepts iterators for an argument to Promise.all().

In Dojo 1, our promise implementation used to accept either an Array or an Object map. When dealing with a complex promise situation, it is very handy to have a named result set, versus just an index based one.

@sebilasse requested we consider adding it to the Promise implementation in dojo-shim (see: dojo/shim#38) but that would mis-align the Promise implementation. We do have Task where we could put that, but since .all() is a static method, we could also create a promise.all function that also accepted an iterator or an object map.