3 ms·
Yeah, LitElement definitely has a cleaner render template. How would one do a computed property in LitElement?
by megaman821 6y ago
Yeah, LitElement definitely has a cleaner render template. How would one do a computed property in LitElement?
- spankalee 6y agoYou 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.