Add properties static property to avoid empty xChanged methods
This commit is contained in:
parent
57dacb29c0
commit
7a299cf07c
1 changed files with 1 additions and 0 deletions
|
@ -70,6 +70,7 @@ export class Better extends HTMLElement {
|
||||||
.getOwnPropertyNames(this.prototype)
|
.getOwnPropertyNames(this.prototype)
|
||||||
.filter(name => name.search(/Changed$/)+1)
|
.filter(name => name.search(/Changed$/)+1)
|
||||||
.map(name => name.replace(/Changed$/, ''))
|
.map(name => name.replace(/Changed$/, ''))
|
||||||
|
.concat(this.properties ?? [])
|
||||||
const attributes = names.map(attr => attr.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase())
|
const attributes = names.map(attr => attr.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase())
|
||||||
Object.defineProperty(this, "observedAttributes", {
|
Object.defineProperty(this, "observedAttributes", {
|
||||||
get() { return attributes }
|
get() { return attributes }
|
||||||
|
|
Loading…
Reference in a new issue