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

Gleams use expression

$
0
0

I use pattern matching on awaits, whenever possible, if I use promises. This way I’m forced to thing / handle errors as well.

let f = async x =>
  switch await x() {
  | result => Console.log(result)
  | exception JsError(err) => Console.error(err)
  }


Viewing all articles
Browse latest Browse all 2592

Trending Articles