rescript-lang.org
rescript-lang.org copied to clipboard
Add section about JSON literal
https://github.com/reason-association/reasonml.org/blob/master/pages/docs/reason-compiler/latest/function.mdx#fixed-arguments
The [@bs.as "exit"] and the placeholder _ argument together indicates that you want the first argument to compile to the string "exit". You can also use any JSON literal with bs.as: [@bs.as {json|true|json}], [@bs.as {json|{"name": "John"}|json}], etc.
Above was about everything I could find about JSON literal on the doc and it doesn't have its own section. Also, it is hard to find about this. I think it should be included in a doc about JSON or have its own page and better paragraphs.
@ryyppy and other maintainers. Would like to ask your opinion.
Should JSON literal be documented on this page?
Or does it need its own page?
What should be the content of the documentation? (I am pretty new to reason so I am not sure if this is used in the other contexts than just [@bs.as] decorator. What are the other use cases or examples?)