Async loop for callbacks
Wed Jul 08 2020 11:05:33 GMT+0000 (UTC)
Saved by
@salitha.pathi
#javascript
#async
const async = require("async");
async.eachSeries(updates, (up, next) => {
techEntriesList.push(up.entryId);
if (up.subJobType && up.userId) {
up.jobId = jobId;
updatePeopleWithCallback(jobId, up, jobUpdates, (err, technician) => {
if (technician) technicianList.push(technician);
console.log(Date.now());
next();
return;
});
}
});
content_copyCOPY
Comments