Skip to content

Add section about JSON literal #46

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wontheone1 opened this issue May 2, 2020 · 1 comment
Open

Add section about JSON literal #46

wontheone1 opened this issue May 2, 2020 · 1 comment

Comments

@wontheone1
Copy link

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.

@wontheone1
Copy link
Author

@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?)

@ryyppy ryyppy transferred this issue from rescript-association/reasonml.org Aug 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant