I’m trying to figure out how to write a custom Json Encoder using bs-json
, and I’m having trouble understanding the examples in the repo. The object I want to encode is in the format list(customType)
. Any idea on how to approach this?
Thanks!
I’m trying to figure out how to write a custom Json Encoder using bs-json
, and I’m having trouble understanding the examples in the repo. The object I want to encode is in the format list(customType)
. Any idea on how to approach this?
Thanks!
Maybe my old article can help you: https://medium.com/@DmytroGladkyi/decode-and-encode-json-in-reasonml-2d484c65cf4e
@gladimdim Thanks for the help! I looked at your guide and the examples again, and I was able to come up with a solution. I figure I’ll leave this here in case it helps anyone else https://github.com/reccanti/shmonsters-reason/blob/master/src/Store.re.
I see the issues here. In bs-json
the tests are in OCaml with it’s respective syntax, not in reason. I will try and work on getting some examples in the bs-json
.
You can copy and paste the code to the OCaml section of https://reasonml.github.io/en/try.html to get ReasonML back