Skip to content

Commit

Permalink
minor refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
brillout committed Sep 12, 2024
1 parent 08b612f commit 6b1d0e0
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion packages/vike-vue-pinia/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"vue-tsc": "^2.0.13"
},
"files": [
"dist"
"dist/"
],
"license": "MIT"
}
4 changes: 3 additions & 1 deletion packages/vike-vue-query/integration/+config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
export { config as default }

import type { DehydratedState, QueryClient, QueryClientConfig } from '@tanstack/vue-query'
import type { Config } from 'vike/types'
import type _ from 'vike-vue/config' // Needed for declaration merging of Config

export default {
const config = {
name: 'vike-vue-query',
require: {
'vike-vue': '>=0.7.0',
Expand Down
4 changes: 2 additions & 2 deletions packages/vike-vue-query/integration/dehydrateVueQuery.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
export { dehydrateVueQuery }

import { dehydrate } from '@tanstack/vue-query'
import type { OnAfterRenderHtmlSync } from 'vike-vue/types'

export { dehydrateVueQuery }

const dehydrateVueQuery: OnAfterRenderHtmlSync = (pageContext): ReturnType<OnAfterRenderHtmlSync> => {
pageContext._vueQueryInitialState = dehydrate(pageContext.queryClient!)
}
4 changes: 2 additions & 2 deletions packages/vike-vue-query/integration/hydrateVueQuery.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
export { hydrateVueQuery }

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

export { hydrateVueQuery }

const hydrateVueQuery: OnBeforeRenderClientSync = (pageContext): ReturnType<OnBeforeRenderClientSync> => {
if (!pageContext.isHydration) {
return
Expand Down
4 changes: 2 additions & 2 deletions packages/vike-vue-query/integration/installVueQuery.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
export { installVueQuery }

import { QueryClient, VueQueryPlugin } from '@tanstack/vue-query'
import type { OnCreateAppSync } from 'vike-vue/types'

export { installVueQuery }

const installVueQuery: OnCreateAppSync = (pageContext): ReturnType<OnCreateAppSync> => {
const queryClient = new QueryClient(pageContext.config.queryClientConfig)
pageContext.app.use(VueQueryPlugin, { queryClient })
Expand Down
2 changes: 1 addition & 1 deletion packages/vike-vue-query/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"vue-tsc": "^2.0.13"
},
"files": [
"dist"
"dist/"
],
"license": "MIT"
}

0 comments on commit 6b1d0e0

Please sign in to comment.