From 7a299cf07c6835e6feaf44c6a4448440716bd706 Mon Sep 17 00:00:00 2001 From: DarkWiiPlayer Date: Mon, 2 Aug 2021 22:58:52 +0200 Subject: [PATCH] Add properties static property to avoid empty xChanged methods --- better.js | 1 + 1 file changed, 1 insertion(+) diff --git a/better.js b/better.js index c9ede94..657a0e4 100644 --- a/better.js +++ b/better.js @@ -70,6 +70,7 @@ export class Better extends HTMLElement { .getOwnPropertyNames(this.prototype) .filter(name => name.search(/Changed$/)+1) .map(name => name.replace(/Changed$/, '')) + .concat(this.properties ?? []) const attributes = names.map(attr => attr.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase()) Object.defineProperty(this, "observedAttributes", { get() { return attributes }