1
0
Fork 1
mirror of https://github.com/elk-zone/elk.git synced 2024-11-19 23:40:07 +00:00
elk/composables/hydration.ts
2022-12-22 02:27:16 +00:00

15 lines
321 B
TypeScript

export const isHydrated = computed(() => {
if (process.server)
return { value: false }
const nuxtApp = useNuxtApp()
if (!nuxtApp.isHydrating)
return { value: false }
const hydrated = ref(false)
nuxtApp.hooks.hookOnce('app:suspense:resolve', () => {
hydrated.value = true
})
return hydrated
})