Skip to content

Commit

Permalink
fix(api/hooks.js): dispatch 'ready' _after_ runtime init
Browse files Browse the repository at this point in the history
  • Loading branch information
jwerle committed Oct 3, 2023
1 parent bbdeaa6 commit 77622de
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api/hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,14 +243,15 @@ export class Hooks extends EventTarget {
// prior to hook initialization
if (isRuntimeInitialized) {
dispatchLoadEvent(this)
dispatchReadyEvent(this)
dispatchInitEvent(this)
dispatchReadyEvent(this)
return
}

addEventListenerOnce(global, RUNTIME_INIT_EVENT_NAME, () => {
isRuntimeInitialized = true
dispatchInitEvent(this)
dispatchReadyEvent(this)
})

if (!isWorkerContext && readyState !== 'complete') {
Expand All @@ -259,7 +260,6 @@ export class Hooks extends EventTarget {

isGlobalLoaded = true
dispatchLoadEvent(this)
dispatchReadyEvent(this)
}

/**
Expand Down

0 comments on commit 77622de

Please sign in to comment.