I currently have a type in my application layer that has some
option properties. I’m using a library (Automerge) that requires that values are JSON-like, so no properties can be defined as
undefined or it throws a runtime error. I have a few options (no pun intended) about what to do here, but I’m trying to get a sense of what the most idiomatic/ergonomic solution here might be:
optionin my application domain model and pass
nullfor the nulalble properties instead of
- Strip the undefined keys by
stringify->parsebefore passing to Automerge.
- Something else I haven’t thought of?
I guess the basic question is how much of a smell is using
Js.Nullable.t “inside” of the application domain and if it’s pretty smelly, what are some common patterns to push that type closer to the JS-edge?