Skip to content

Latest commit

 

History

History
31 lines (22 loc) · 597 Bytes

decorator_get.mdx

File metadata and controls

31 lines (22 loc) · 597 Bytes
id keywords name summary category
get-decorator
get
decorator
@get
This is the `@get` decorator.
decorators

The @get decorator is used to bind to a property of an object.

Example

<CodeTab labels={["ReScript", "JS Output"]}>

type window
@bs.val external window: window = "window"
@bs.get external getName: window => string = "name"

let name = getName(window)
var name = window.name;

References