Web from the future

@webfromfuture ยท RSS ยท Newsletter

Decorators

No
No
No
No
@defineElement("my-class")
class C extends HTMLElement {
  @reactive accessor clicked = false;
}

Decorators are functions called on classes, class elements, or other JavaScript syntax forms during definition.

They have three main capabilities:

Although they are not officially part of the language yet, they can be used with TypeScript.


โ† Relative colors
See all ๐Ÿ”ฎ
Import JSON in JS โ†’