Let's say we have some Promise for we knew it resolves at some point. Now I have sync code (ag. no await possible) called repeatedly (eg. onAnimationFrame). How to use the result of the promise there, if it is fullfilled?
Like (JS pseudocode):
let promise=FetchSomething();
let updater = ()=>{
drawSomething();
if(promise IS FULLFILLED) // how to know if fullfilled?
drawThing(RESULT OF promise); // how to get the result here?
requestAnimationFrame(updater);
}
updater();