Syntax Lookup

Enter some language construct you want to know more about.
This is the @obj decorator.

Deprecated since compiler version 11.0. It was mainly used to bind to JS param objects with many optional fields, records with optional fields are now natively supported.

The @obj decorator is used to create functions that return JavaScript objects with properties that match the function's parameter labels.

Example

ReScriptJS Output
@obj
external action: (~name: string, unit) => _ = ""

let helloAction = action(~name="Hello", ())

References