-
-
Notifications
You must be signed in to change notification settings - Fork 61
Open
Description
This section of the documentation has some info about using Js.t objects to represent Javscript objects.
The only way I can actually find to create these is using the special syntax and the Ocaml equivalent with @mel.obj:
let john = {
"name": "john",
"age": 99,
};
let t = john##name;
These are, as the documentation suggests typed as an OCaml object wrapped in a Js.t type.
Is there any way to use an actual OCaml object literal and wrap it in a Js.t type? This would allow taking advantage of stuff like classes and inheritance which are not exactly the favorite features of most OCamlers but are good to have in your back pocket when you really need them.
If not, it would be good to clarify the documentation as to what's going on here and how OCaml objects relate to what the above syntax is doing.
Metadata
Metadata
Assignees
Labels
No labels