From 892bf802bab299413aa2167d2c9ef06780da521c Mon Sep 17 00:00:00 2001 From: Romuald Brillout Date: Thu, 12 Sep 2024 17:25:17 +0200 Subject: [PATCH] minor refactor --- packages/vike-vue-query/integration/onAfterRenderHtml.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/vike-vue-query/integration/onAfterRenderHtml.ts b/packages/vike-vue-query/integration/onAfterRenderHtml.ts index 05a13bcc..adc02ef6 100644 --- a/packages/vike-vue-query/integration/onAfterRenderHtml.ts +++ b/packages/vike-vue-query/integration/onAfterRenderHtml.ts @@ -4,5 +4,10 @@ import { dehydrate } from '@tanstack/vue-query' import type { OnAfterRenderHtmlSync } from 'vike-vue/types' const onAfterRenderHtml: OnAfterRenderHtmlSync = (pageContext): ReturnType => { + dehydrateVueQuery(pageContext) +} + +type PageContext = Parameters[0] +function dehydrateVueQuery(pageContext: PageContext) { pageContext._vueQueryInitialState = dehydrate(pageContext.queryClient!) }