Skip to content

Commit

Permalink
dispatching load event on component load complete
Browse files Browse the repository at this point in the history
  • Loading branch information
Kal-Aster committed Nov 12, 2020
1 parent 9feff92 commit 5df881e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion index.next.js
Expand Up @@ -18,7 +18,10 @@ lazy.export = function lazyExport(Loader, Component) {
mount(el, parentScope) {
this.el = el
this.isMounted = true
const mount = () => this.mountLazyComponent(parentScope)
const mount = () => {
this.mountLazyComponent(parentScope)
this.el.dispatchEvent(new Event("load"))
}

if (cachedComponent) {
mount()
Expand Down

0 comments on commit 5df881e

Please sign in to comment.