Skip to content
This repository has been archived by the owner on Oct 26, 2024. It is now read-only.

Commit

Permalink
Merge pull request #8 from 94noni/issue-7
Browse files Browse the repository at this point in the history
Dispatch an event when content is loaded
  • Loading branch information
guillaumebriday authored Aug 9, 2023
2 parents 3d032de + 0c32c87 commit 11e5bf2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,15 @@ export default class extends Controller {
.then((html: string) => {
this.element.innerHTML = html

this.dispatch('content-loader:loaded')

if (this.loadScriptsValue) {
this.loadScripts()
}
})
.catch(function (error) {
this.dispatch('content-loader:failed', { detail: { error: error } })
})
}

startRefreshing (): void {
Expand Down

0 comments on commit 11e5bf2

Please sign in to comment.