February 2019
Beginner to intermediate
180 pages
4h 4m
English
The [@bs.send] decorator is for binding to an object's methods and properties. When using [@bs.send], the first argument is always the object. If there are remaining arguments, they will get applied to the object's method:
[@bs.val] external document: Dom.document = "";[@bs.send] external getElementById: (Dom.document, string) => Dom.element = "";let element = getElementById(document, "root");
The Dom module is also provided by BuckleScript and provides type declarations for the DOM.
Be ...
Read now
Unlock full access