Skip to content

Latest commit

 

History

History
32 lines (22 loc) · 589 Bytes

decorator_new.mdx

File metadata and controls

32 lines (22 loc) · 589 Bytes
id keywords name summary category
new-decorator
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.

Example

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

type t

@new external create: unit => t = "Date"

let now = create()
var now = new Date();

References