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