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
Subtilities of evt.waitFor(...)
evt.waitFor(...) Last updated
Was this helpful?