We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b6212f7 commit af2bd3dCopy full SHA for af2bd3d
src/index.ts
@@ -163,12 +163,18 @@ export default class IncludeFragmentElement extends HTMLElement {
163
return response.text()
164
})
165
.then(data => {
166
+ // Dispatch `load` and `loadend` async to allow
167
+ // the `load()` promise to resolve _before_ these
168
+ // events are fired.
169
task().then(() => {
170
this.dispatchEvent(new Event('load'))
171
this.dispatchEvent(new Event('loadend'))
172
173
return data
174
}, error => {
175
+ // Dispatch `error` and `loadend` async to allow
176
177
178
179
this.dispatchEvent(new Event('error'))
180
0 commit comments