Async loop for callbacks

PHOTO EMBED

Wed Jul 08 2020 11:05:33 GMT+0000 (Coordinated Universal Time)

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