Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
combineDataPromise.then(function(combinedData){
// farm out requests
forEach.call(combinedData, function(combined){
base.getListData(combined.set).then(function(data){
if(combined.pendingRequests.length === 1) {
combined.pendingRequests[0].deferred.resolve(data);
} else {
forEach.call(combined.pendingRequests, function(pending){
pending.deferred.resolve( {data: self.getSubset(pending.set, combined.set, getItems(data) )} );
});
}
});
});
});
base.getListData(combined.set).then(function(data){
if(combined.pendingRequests.length === 1) {
combined.pendingRequests[0].deferred.resolve(data);
} else {
forEach.call(combined.pendingRequests, function(pending){
pending.deferred.resolve( {data: self.getSubset(pending.set, combined.set, getItems(data) )} );
});
}
});
});