Wait until a condition becomes truthy. This under the hood implements polling to evaluate the condition so use wisely.
let someValue = 0;func.waitUntil(()=> someValue === 5).then(()=> { console.log('some value is 5!!!');})setTimeout(()=> { someValue = 5;}, 1000); Copy
let someValue = 0;func.waitUntil(()=> someValue === 5).then(()=> { console.log('some value is 5!!!');})setTimeout(()=> { someValue = 5;}, 1000);
Wait until a condition becomes truthy. This under the hood implements polling to evaluate the condition so use wisely.