I'm currently facing a challenge with moving a function from AngularJs to VueJs. I would really appreciate any help or suggestions you may have!
items = {
one: {...details here...},
two: {},
}
In AngularJs:
var promises = [];
var deferred = $q.defer();
angular.forEach(items, function(details) {
promises.push(details.promise);
});
$q.all(promises).finally(function() {
deferred.resolve();
});
return deferred.promise;
Here's what I've come up with in VueJs so far:
let promises = [];
for (let [name, details] of Object.entries(items)) {
promises.push(new Promise((resolve) => {resolve(details)}));
}
return Promise.all(promises);
Any feedback is highly appreciated! Thank you!