Basically what I'm trying to do boils down to
function a() {
// Do stuff that waits for things etc
b(a);
}
function b(f) {
f()
}
function a() { b(a); }; function b(f) { f(); }; a() That will cause a too much recursion error after a while though. Apparently javascript doesn't support tail-recursion so that won't work either. I can't think of any way to use a loop here either since I don't want the code executed immediately. So any way to do this or is it impossible?
Also I apologize if this has been asked before, couldn't find anything that helped.
Edit: Also before anyone asks, no I'm not actually using setTimeout
so setIntervall
isn't an option.
Edit again: Alright hope this shows what I'm trying to do better. I need to call the same code after waiting for things to complete again without actually putting it in a loop and blocking the program.