`slikts has quit [Quit: No Ping reply in 180 seconds.]
<cods>
Hi. Any idea how to obtain a Javascript value of this shape: [{"type": "X", "title": "foo"}, {"type": "Y", "value": 123}]? I'm using Js.Array and bs.deriving abstract to build the final value, built from a Reason list and matching records, but at best I end up with [[{"type": "X", ...}], [{"type": "Y", ...}]] (1-element array because of the tagged representation).
<cods>
I can't use Js.Dict because the value can be of different types (number, string) as shown.
<cods>
For those wondering, the answer I got on SO: Use Obj.magic instead (and type it with an abstract type).
<reynir>
Urgh, that's not a good answer IMO
<cods>
I'm interested by anything better :)
<reynir>
cods: Obj.magic is basically unsafe cast. All sorts of "interesting" behavior could happen when you use that. I would think you should rather do some manual runtime checking of the shape of the object, but I don't know what BS offers for this