How to make a forever/infinite loop of async events in ReScript?

Just tried this again. Thanks to async/await this works now as expected. E.g.

let forever = async () => {
  while true {
    let result = await n_async_event()
    Js.log(result)
  }
}

[Playground]

4 Likes