I'm using this function here twice to load csv data: http://papaparse.com/
Papa.parse("http://example.com/file.csv", {
download: true,
complete: function(results) {
console.log(results);
}
});
When both files are ready I want to execute another function that depends on the results from both. I'm styling a map with markers.
I thought about JavaScript Promises. Can someone give me a hand on how that would look like if you have, say, 2 csv files/urls?
Currently I have the following libraries activated:
Jquery 3.2.1
Papa Parse 4
Lastly, I'm aware of: How to use Promises with PapaParse? But I can't figure out where to put the code for it to work with 2 or more files.