So, my code looks like this:
Papa.parse(my_local_file, {
step: async function(row, parser){
console.log('starting wait');
await new Promise(res => {setTimeout(() => {res(7)}, 10000)});
console.log('Row -> ' + row.data);
},
complete: function (){
console.log('complete');
}
});
lets say the file has 10 rows in it, it will print 10 starting wait
without any delay between them and then immediately after that, it will print complete
. and then 10 secs after that, it will print the rows. I was expecting there's a delay of 10 secs for each row. the 10 sec delay is only once, and all the rows will print immediately. it's as if the step
function is run concurrently?
What's going on here?
EDIT: fixed the code