new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

TanStack Query · Reference · all subjects

environmentmanager

6 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

environmentManager overview

The environmentManager manages how TanStack Query detects whether the current runtime should be treated as server-side. By default, it uses the same server detection as the exported isServer utility from query-core. Use this manager to override server detection globally for runtimes that are not traditional browser/server environments, such as extension workers.

environmentManager.isServer method

The isServer method returns whether the current runtime is treated as a server environment. It is called with no parameters and returns a boolean. Example usage: const server = environmentManager.isServer()

environmentManager.setIsServer method

The setIsServer method overrides the server check globally. It takes one parameter: isServerValue, which is a function that returns a boolean. This function is called to determine if the current runtime is a server environment. Example: environmentManager.setIsServer(() => { return typeof window === 'undefined' && !('chrome' in globalThis) })

environmentManager.setIsServer restore default

To restore the default server detection behavior after overriding it, call setIsServer with the isServer utility imported from @tanstack/react-query. Example: environmentManager.setIsServer(() => isServer)

environmentManager.setIsServer parameter type

The setIsServer method accepts one option parameter: isServerValue of type () => boolean, which is a function that returns a boolean indicating whether the runtime is a server environment.

environmentManager usage example for extension workers

For runtimes like extension workers that are not traditional browser/server environments, use environmentManager to override the default server detection with custom logic, such as checking for the presence of specific global objects like 'chrome' in globalThis.

Give your agent this brain