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

Optional field in a record best practice

$
0
0

I have:

type xyz = {
  a: int,
  b: option<string>
}

I could also do

type xyz = {
  a: int,
  b?: string
}

Which approach is would you use where?
I my case xyz is my own code and not part of a binding.
It is also not a props records.


Viewing all articles
Browse latest Browse all 2592

Trending Articles