Syntax Lookup
Enter some language construct you want to know more about.
This is the @send decorator.
The @send
decorator is used to bind to a method on an object or array.
Example
// Bind to a method on an object
type document
@send external getElementById: (document, string) => Dom.element = "getElementById"
@val external doc: document = "document"
let el = getElementById(doc, "myId")
// Bind to a method on an array
@send external fillInPlace: (array<'a>, 'a) => array<'a> = "fill"
let a = fillInPlace([1, 2, 3], 99)