custom elements base class factory with properties mapped to observed attributes
🔧 Install · 🧩 Example · 📜 API docs · 🔥 Releases · 💪🏼 Contribute · 🖐️ Help
$ npm i with-properties
class Foo extends withProperties(
HTMLElement,
class {
string? = String
number? = Number
boolean = Boolean
implicitString = 'string'
implicitNumber = 123
implicitBoolean = true
somethingElse? = new Uint8Array(1)
}
) {}
parent
C The parent constructor to extend (usuallyHTMLElement
)propsClass
Constructor<P> A "props" class to create the properties from
Returns any A base constructor to be extended from
All contributions are welcome!
MIT © 2021 stagas