Skip to content

Commit

Permalink
custom element: more meaningful name #setContent()
Browse files Browse the repository at this point in the history
  • Loading branch information
laurentpayot committed Apr 11, 2023
1 parent 62650ea commit 8a1c4bb
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions minidenticons.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ export const identiconSvg =
static #memoized = {}
#isConnected = false
connectedCallback() {
this.#identiconSvg()
this.#setContent()
this.#isConnected = true
}
// attributeChangedCallback() is called for every observed attribute before connectedCallback()
attributeChangedCallback() { if (this.#isConnected) this.#identiconSvg() }
#identiconSvg() {
attributeChangedCallback() { if (this.#isConnected) this.#setContent() }
#setContent() {
const args = IdenticonSvg.observedAttributes
.map(key => this.getAttribute(key) || undefined)
const memoKey = args.join(',')
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.

2 changes: 1 addition & 1 deletion no-custom-element.min.js

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

0 comments on commit 8a1c4bb

Please sign in to comment.