Skip to content

Commit

Permalink
minor refactor: rename hydrateVueQuery => onBeforeRenderClient
Browse files Browse the repository at this point in the history
  • Loading branch information
brillout committed Sep 12, 2024
1 parent 892bf80 commit 858734a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion packages/vike-vue-query/integration/+config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const config = {
},
onCreateApp: 'import:vike-vue-query/__internal/integration/onCreateApp:onCreateApp',
onAfterRenderHtml: 'import:vike-vue-query/__internal/integration/onAfterRenderHtml:onAfterRenderHtml',
onBeforeRenderClient: 'import:vike-vue-query/__internal/integration/hydrateVueQuery:hydrateVueQuery',
onBeforeRenderClient: 'import:vike-vue-query/__internal/integration/onBeforeRenderClient:onBeforeRenderClient',
meta: {
queryClientConfig: {
env: {
Expand Down
4 changes: 2 additions & 2 deletions packages/vike-vue-query/integration/onAfterRenderHtml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import { dehydrate } from '@tanstack/vue-query'
import type { OnAfterRenderHtmlSync } from 'vike-vue/types'

const onAfterRenderHtml: OnAfterRenderHtmlSync = (pageContext): ReturnType<OnAfterRenderHtmlSync> => {
dehydrateVueQuery(pageContext)
deonBeforeRenderClient(pageContext)
}

type PageContext = Parameters<typeof onAfterRenderHtml>[0]
function dehydrateVueQuery(pageContext: PageContext) {
function deonBeforeRenderClient(pageContext: PageContext) {
pageContext._vueQueryInitialState = dehydrate(pageContext.queryClient!)
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
export { hydrateVueQuery }
export { onBeforeRenderClient }

import { hydrate } from '@tanstack/vue-query'
import type { OnBeforeRenderClientSync } from 'vike-vue/types'

const hydrateVueQuery: OnBeforeRenderClientSync = (pageContext): ReturnType<OnBeforeRenderClientSync> => {
const onBeforeRenderClient: OnBeforeRenderClientSync = (pageContext): ReturnType<OnBeforeRenderClientSync> => {
if (!pageContext.isHydration) {
return
}
Expand Down
6 changes: 3 additions & 3 deletions packages/vike-vue-query/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"./config": "./dist/+config.js",
"./__internal/integration/onCreateApp": "./dist/onCreateApp.js",
"./__internal/integration/onAfterRenderHtml": "./dist/onAfterRenderHtml.js",
"./__internal/integration/hydrateVueQuery": "./dist/hydrateVueQuery.js"
"./__internal/integration/onBeforeRenderClient": "./dist/onBeforeRenderClient.js"
},
"typesVersions": {
"*": {
Expand All @@ -30,8 +30,8 @@
"__internal/integration/onAfterRenderHtml": [
"./dist/onAfterRenderHtml.d.ts"
],
"__internal/integration/hydrateVueQuery": [
"./dist/hydrateVueQuery.d.ts"
"__internal/integration/onBeforeRenderClient": [
"./dist/onBeforeRenderClient.d.ts"
]
}
},
Expand Down

0 comments on commit 858734a

Please sign in to comment.