Skip to content

Commit

Permalink
custom element #isConnected private field for Terser mangling
Browse files Browse the repository at this point in the history
  • Loading branch information
laurentpayot committed Apr 10, 2023
1 parent 68d3f52 commit cb3d34b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions minidenticons.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ export const identiconSvg =
class IdenticonSvg extends HTMLElement {
static observedAttributes = ['username', 'saturation', 'lightness']
static memo = {}
isConnected = false
#isConnected = false
connectedCallback() {
this.identiconSvg()
this.isConnected = true
this.#isConnected = true
}
// attributeChangedCallback() is called for every observed attribute before connectedCallback()
attributeChangedCallback() { if (this.isConnected) this.identiconSvg() }
attributeChangedCallback() { if (this.#isConnected) this.identiconSvg() }
identiconSvg() {
const args = IdenticonSvg.observedAttributes
.map(key => this.getAttribute(key) || undefined)
Expand Down
2 changes: 1 addition & 1 deletion minidenticons.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion minidenticons.min.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit cb3d34b

Please sign in to comment.