MCPcopy Create free account
hub / github.com/TanStack/query / functionalUpdate

Function functionalUpdate

packages/query-core/src/utils.ts:123–130  ·  view source on GitHub ↗
(
  updater: Updater<TInput, TOutput>,
  input: TInput,
)

Source from the content-addressed store, hash-verified

121export function noop() {}
122
123export function functionalUpdate<TInput, TOutput>(
124 updater: Updater<TInput, TOutput>,
125 input: TInput,
126): TOutput {
127 return typeof updater === 'function'
128 ? (updater as (_: TInput) => TOutput)(input)
129 : updater
130}
131
132export function isValidTimeout(value: unknown): value is number {
133 return typeof value === 'number' && value >= 0 && value !== Infinity

Callers 2

setQueryDataMethod · 0.90
utils.test-d.tsxFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected