MCPcopy
hub / github.com/TanStack/router / batch

Function batch

packages/router-core/src/utils/batch.ts:8–18  ·  view source on GitHub ↗
(fn: () => T)

Source from the content-addressed store, hash-verified

6// On the server we don't subscribe/render reactively, so a lightweight
7// implementation that just executes is enough.
8export function batch<T>(fn: () => T): T {
9 if (isServer) {
10 return fn()
11 }
12
13 let result!: T
14 storeBatch(() => {
15 result = fn()
16 })
17 return result
18}

Callers 4

RouterCoreClass · 0.90
executeBeforeLoadFunction · 0.90
updateContextFunction · 0.90
hydrateFunction · 0.90

Calls 1

fnFunction · 0.50

Tested by

no test coverage detected