fix(nuxt): call onNuxtReady callback without arguments (#27428)

This commit is contained in:
Harlan Wilton 2024-06-11 23:33:22 +10:00 committed by GitHub
parent 115fc2d18f
commit 14fecc9f73
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -7,8 +7,8 @@ export const onNuxtReady = (callback: () => any) => {
const nuxtApp = useNuxtApp() const nuxtApp = useNuxtApp()
if (nuxtApp.isHydrating) { if (nuxtApp.isHydrating) {
nuxtApp.hooks.hookOnce('app:suspense:resolve', () => { requestIdleCallback(callback) }) nuxtApp.hooks.hookOnce('app:suspense:resolve', () => { requestIdleCallback(() => callback()) })
} else { } else {
requestIdleCallback(callback) requestIdleCallback(() => callback())
} }
} }