My code is something like this:
var trueOrFalse = true;
while(trueOrFalse){
fetch(\'some/address\').then(){
if(someCondition){
trueOrFals
Now with async/await we can use awesome while loops to do cool stuff.
var getStuff = async () => {
var pages = 0;
while(true) {
var res = await fetch(`public/html/${pages ++}.html`);
if(!res.ok) break; //Were done let's stop this thing
var data = await res.text();
//Do something with data
};
console.log("Look ma! I waited!"); //Wont't run till the while is done
};