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

Bind in ReScript (not to import JS, but to bind multiple Option or Result)

$
0
0

Another alternative using Array:

let a = Some(3)
let b = Some(5)
let result = [a, b]->Array.reduce(0, (acc, opt) => acc + opt->Option.getOr(0))

Viewing all articles
Browse latest Browse all 2592

Trending Articles