Make isServer configurable #9591
Unanswered
Maxim-Mazurok
asked this question in
Ideas
Replies: 1 comment
-
This is my patch with a workaround (hardcode
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm using TanStack query with
@vue/reactivity
in a NodeJS environment, butisServer
checks like thisquery/packages/query-core/src/utils.ts
Line 77 in a1b1279
refetchInterval
+refetchIntervalInBackground
.I loved the simplicity and declarativeness of Vue+Query in FE, and I brought this into NodeJS.
I'm using this simple wrapper:
Defining my queries:
and then using them:
The problem that I'm running into is that if I want to use automatic refresh - it doesn't work. Because it doesn't pass
isServer
checks. If I make this function always return false - then it works fine.I undersatnd this was added to detect SSR, but perhaps we could make this configurable flag, and rename to
isServerSSR
or something? Because in my case I'm "server", but have nothing to do with SSR, just want to enjoy the awesome reactivity of vue retriability of query :)Thank you!
Beta Was this translation helpful? Give feedback.
All reactions