id | keywords | name | summary | category | ||
---|---|---|---|---|---|---|
new-decorator |
|
@new |
This is the `@new` decorator. |
decorators |
The @new
decorator is used whenever you need to bind to a JavaScript
class constructor that requires the new
keword for instantiation.
<CodeTab labels={["ReScript", "JS Output"]}>
type t
@new external create: unit => t = "Date"
let now = create()
var now = new Date();