Open lukefx opened 9 years ago
So basically the idea is the same as Dojo where we can pass an object to Promise.all() and the results are paired with their keys. With this way I can identify where the result came from.
Instead of an array we use and object
Promise.all({ tableA: Promise.when(queryTask1.execute(query)), tableB: Promise.when(queryTask2.execute(query)) }).then(onTaskResult).otherwise(onTaskFault);
Then we can use the object keys to identify the results
private function onTaskResult(results:Object):void { for (var key:String in results) { ... } }
So basically the idea is the same as Dojo where we can pass an object to Promise.all() and the results are paired with their keys. With this way I can identify where the result came from.
Instead of an array we use and object
Then we can use the object keys to identify the results