Syntax Lookup

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

The @meth decorator is used to call a function on a JavaScript object, and avoid issues with currying.

Example

Suppose we have the following JavaScript:

JS
function say(a, b) { console.log(a, b); } var john = { say, };

We can model and bind to this object as follows.

ReScriptJS Output
type person = {@meth "say": (string, string) => unit}

@val external john: person = "john"

john["say"]("hey", "jude")