Is there a way to trigger a callback function in the scan function after the for await loop completes?
let personObj = {};
let personArray = [];
async function scan() {
for await (const person of mapper.scan({valueConstructor: Person})) {
decrypt(person.name, function () {
personArray.push(personObj);
});
}
}
For instance, I am thinking of executing console.log(personArray)
once the loop finishes.