diff --git a/examples/vue-query/pages/+queryClientConfig.ts b/examples/vue-query/pages/+queryClientConfig.ts index 3dada269..f4c4f141 100644 --- a/examples/vue-query/pages/+queryClientConfig.ts +++ b/examples/vue-query/pages/+queryClientConfig.ts @@ -7,6 +7,7 @@ const queryClientConfig: QueryClientConfig = { defaultOptions: { queries: { refetchOnWindowFocus: import.meta.env.PROD, + // staleTime: 1000 * 60 * 5, }, }, } diff --git a/examples/vue-query/pages/index/+Page.vue b/examples/vue-query/pages/index/+Page.vue index efaa30f7..6986d7b8 100644 --- a/examples/vue-query/pages/index/+Page.vue +++ b/examples/vue-query/pages/index/+Page.vue @@ -34,6 +34,8 @@ const components = { Counter } const { isError, isPending, isFetching, data, error, suspense } = useQuery({ queryKey: ['movies'], queryFn: fetchMovies, + // Or set global `staleTime` at pages/+queryClientConfig.ts + staleTime: 1000 * 60 * 5, select: (data) => minimize(data), })