FutureEvent
A simple, tiny utility class for promising a future event will occur, allowing you to
await
it. For instance:
{ /** Promise an event will happen eventually. */ const inFiveSeconds = ; /** Fire FutureEvent.ready() after 5s. */ ; console; await inFiveSeconds; console;} ;
Will print ⏱️ Waiting for event...
, wait 5 seconds until the event fires
(non-blocking), and then print ✅ Done!
(Run yourself with node example/
in the root directory.)