From 77622de3331ae5beb1ebad2a5bb469fefbd9b60a Mon Sep 17 00:00:00 2001 From: Joseph Werle Date: Tue, 3 Oct 2023 13:35:37 -0400 Subject: [PATCH] fix(api/hooks.js): dispatch 'ready' _after_ runtime init --- api/hooks.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/hooks.js b/api/hooks.js index e83e35b2c9..2400da6f10 100644 --- a/api/hooks.js +++ b/api/hooks.js @@ -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') { @@ -259,7 +260,6 @@ export class Hooks extends EventTarget { isGlobalLoaded = true dispatchLoadEvent(this) - dispatchReadyEvent(this) } /**