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

Function functionalUpdate

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

Source from the content-addressed store, hash-verified

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

Callers 1

setQueryDataMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected