Quantcast
Channel: ReScript Forum - Latest posts
Viewing all articles
Browse latest Browse all 1991

Await top level promise

$
0
0

Hello,

For a Node/Bun script I need to await the top level promise:

let yow = async () => {
 	Console.log("doing promise stuff") 
}

yow()->Promise.done

compiles to

async function yow() {
  console.log("doing promise stuff");
}

yow();

but I would need this to be await yow(); for Bun to wait until the promise is resolved.
How can I do this?


Viewing all articles
Browse latest Browse all 1991

Latest Images

Trending Articles



Latest Images