MCPcopy
hub / github.com/TanStack/query / setIsServer

Function setIsServer

packages/query-core/src/__tests__/utils.ts:26–37  ·  view source on GitHub ↗
(isServer: boolean)

Source from the content-addressed store, hash-verified

24// This monkey-patches the isServer-value from utils,
25// so that we can pretend to be in a server environment
26export function setIsServer(isServer: boolean) {
27 const original = utils.isServer
28 Object.defineProperty(utils, 'isServer', {
29 get: () => isServer,
30 })
31
32 return () => {
33 Object.defineProperty(utils, 'isServer', {
34 get: () => original,
35 })
36 }
37}

Callers 3

query.test.tsxFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…