3 ms·
There is a beautiful json lib for F# called Thoth. Works on .NET and Fable. Encode.object [ "blockId", Encode.guid data.Id "blockName", Encode.string d
by JaggerJo 6y ago
There is a beautiful json lib for F# called Thoth. Works on .NET and Fable.
Encode.object [
"blockId", Encode.guid data.Id
"blockName", Encode.string data.Name
"nestedType", Nested.Encode data.Nested
]
Decode.object (fun get ->
{ Block.Id = get.Required.Field "blockId" Decode.guid
Block.Name = get.Required.Field "blockName" Decode.string
Block.Nested = Nested.Decode get }