rescript-lang.org icon indicating copy to clipboard operation
rescript-lang.org copied to clipboard

Include %obj() in the Object Creation documentation

Open kevanstannard opened this issue 5 years ago • 4 comments

Would it be worth including an example of using %obj() in the section on Object Creation?

Edit: It's used in examples in the API docs, but not sure if it was intentionally omitted from the main docs or not. Thanks.

kevanstannard avatar Dec 09 '20 09:12 kevanstannard

Can you point me to the API docs?

I am pretty sure the %obj() syntax is obsolete for ReScript code, because we have dedicated JS object syntax for that.

ryyppy avatar Dec 17 '20 14:12 ryyppy

Hi @ryyppy, it's currently used in a couple of spots:

https://rescript-lang.org/docs/manual/latest/api/js/obj#assign

https://rescript-lang.org/docs/manual/latest/api/js#object

kevanstannard avatar Dec 17 '20 19:12 kevanstannard

I've created a small PR to update those examples:

https://github.com/reason-association/rescript-lang.org/pull/138

kevanstannard avatar Dec 17 '20 20:12 kevanstannard

Fixed in #138

ryyppy avatar Dec 17 '20 20:12 ryyppy