Re:From TypeScript to ReScript
by greyblake on Wednesday January 12, 2022 @07:13AM
(#29905305)
There still "weak" points, where incorrect typing can be introduced, e.g. incorrectly written bindings.
Regarding data from HTTP call in theory they can be cast to any type abusing `external` keyword which is meant for binings.
But common and recommend approach is to write codes. Codec would perform all the necessary checks to ensure that the data are in correct shape to satisfy the type restrictions.
You can see some examples here: https://github.com/greyblake/from-typescript-to-rescript/blo...
[ Parent
| on HN ]
There are no comments on this comment yet.