@@ -16,9 +16,8 @@ import type {
1616 QueryObserverResult ,
1717 QueryFunction ,
1818} from '@tanstack/query-core'
19- import { isServer } from '@tanstack/query-core'
2019import { useQueryClient } from './useQueryClient'
21- import { updateState , isQueryKey , cloneDeepUnref , noop } from './utils'
20+ import { updateState , isQueryKey , cloneDeepUnref } from './utils'
2221import type { MaybeRef , WithQueryClientKey } from './types'
2322import type { UseQueryOptions } from './useQuery'
2423import type { UseInfiniteQueryOptions } from './useInfiniteQuery'
@@ -72,20 +71,19 @@ export function useBaseQuery<
7271 const observer = new Observer ( queryClient , defaultedOptions . value )
7372 const state = reactive ( observer . getCurrentResult ( ) )
7473
75- const unsubscribe = ref ( noop )
74+ const unsubscribe = ref ( ( ) => {
75+ // noop
76+ } )
7677
7778 watch (
7879 queryClient . isRestoring ,
7980 ( isRestoring ) => {
8081 // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
8182 if ( ! isRestoring ) {
8283 unsubscribe . value ( )
83- // Nuxt2 memory leak fix - do not subscribe on server
84- if ( ! isServer ) {
85- unsubscribe . value = observer . subscribe ( ( result ) => {
86- updateState ( state , result )
87- } )
88- }
84+ unsubscribe . value = observer . subscribe ( ( result ) => {
85+ updateState ( state , result )
86+ } )
8987 }
9088 } ,
9189 { immediate : true } ,
@@ -106,7 +104,9 @@ export function useBaseQuery<
106104
107105 const suspense = ( ) => {
108106 return new Promise < QueryObserverResult < TData , TError > > ( ( resolve ) => {
109- let stopWatch = noop
107+ let stopWatch = ( ) => {
108+ //noop
109+ }
110110 const run = ( ) => {
111111 if ( defaultedOptions . value . enabled !== false ) {
112112 const optimisticResult = observer . getOptimisticResult (
0 commit comments