evt.waitFor(...)
Without timeout
import { Evt } from "evt";
const evtText = Evt.create<string>();
setTimeout(()=> evtText.post("Hi!"), 1500);
(async ()=>{
//waitFor return a promise that will resolve next time
//post() is invoked on evtText.
const text = await evtText.waitFor();
console.log(text);
})();With timeout
Difference between evt.waitFor(...) and evt.attachOnce(...)
evt.waitFor(...) and evt.attachOnce(...)Last updated