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

Cannot able create a Record from another Record (With all optional keys)

$
0
0

I have 250 fields in my prop type.

For now, I did this

let mapper: (a) => b = (a) => {
  ({ t ?: a.t
  , l ?: a.l->intToString
  , p ?: a.p->arrayToString
  } : b)
}

But in this also, If you remove any key for code … rescript will compile successfully. There is no way to ensure all keys are copied. That needs to be manage by team.


Viewing all articles
Browse latest Browse all 2592

Trending Articles