From 14fecc9f73cf6491aef4e715a37b5dfe6d894467 Mon Sep 17 00:00:00 2001 From: Harlan Wilton Date: Tue, 11 Jun 2024 23:33:22 +1000 Subject: [PATCH] fix(nuxt): call `onNuxtReady` callback without arguments (#27428) --- packages/nuxt/src/app/composables/ready.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/nuxt/src/app/composables/ready.ts b/packages/nuxt/src/app/composables/ready.ts index 2360bc002d..d4a1257a19 100644 --- a/packages/nuxt/src/app/composables/ready.ts +++ b/packages/nuxt/src/app/composables/ready.ts @@ -7,8 +7,8 @@ export const onNuxtReady = (callback: () => any) => { const nuxtApp = useNuxtApp() if (nuxtApp.isHydrating) { - nuxtApp.hooks.hookOnce('app:suspense:resolve', () => { requestIdleCallback(callback) }) + nuxtApp.hooks.hookOnce('app:suspense:resolve', () => { requestIdleCallback(() => callback()) }) } else { - requestIdleCallback(callback) + requestIdleCallback(() => callback()) } }