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:
- Replace the decorated value
- Access the value and share it
- Initialize the value
Although they are not officially part of the language yet, they can be used with TypeScript.