We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 73421ea commit ee0dc3cCopy full SHA for ee0dc3c
src/index.ts
@@ -50,6 +50,8 @@ export default class IncludeFragmentElement extends HTMLElement {
50
return this.#getData()
51
}
52
53
+ #busy = false
54
+
55
attributeChangedCallback(attribute: string, oldVal: string | null): void {
56
if (attribute === 'src') {
57
// Source changed after attached so replace element.
@@ -132,6 +134,9 @@ export default class IncludeFragmentElement extends HTMLElement {
132
134
)
133
135
136
#handleData(): Promise<void> {
137
+ if (this.#busy) return Promise.resolve()
138
+ this.#busy = true
139
140
this.#observer.unobserve(this)
141
return this.#getData().then(
142
(html: string) => {
0 commit comments