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

Function functionalUpdate

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

Source from the content-addressed store, hash-verified

96export function noop() {}
97
98export function functionalUpdate<TInput, TOutput>(
99 updater: Updater<TInput, TOutput>,
100 input: TInput,
101): TOutput {
102 return typeof updater === 'function'
103 ? (updater as (_: TInput) => TOutput)(input)
104 : updater
105}
106
107export function isValidTimeout(value: unknown): value is number {
108 return typeof value === 'number' && value >= 0 && value !== Infinity

Callers 1

setQueryDataMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected