3 ms·
You really don't need any special for a computed property. I'd start with a simple getter: class MyElement extends LitElement { @property() value: nu
by spankalee 6y ago
You really don't need any special for a computed property. I'd start with a simple getter:
class MyElement extends LitElement {
@property() value: number = 42;
get valueSquared() {
return this.value ** 2;
}
}
If the value is expensive to compute you can memoize it in the getter, or set it in update.