MCPcopy
hub / github.com/TanStack/query / getResult

Function getResult

packages/svelte-query/src/useMutationState.ts:12–22  ·  view source on GitHub ↗
(
  mutationCache: MutationCache,
  options: MutationStateOptions<TResult>,
)

Source from the content-addressed store, hash-verified

10import type { MutationStateOptions } from './types.js'
11
12function getResult<TResult = MutationState>(
13 mutationCache: MutationCache,
14 options: MutationStateOptions<TResult>,
15): Array<TResult> {
16 return mutationCache
17 .findAll(options.filters)
18 .map(
19 (mutation): TResult =>
20 (options.select ? options.select(mutation) : mutation.state) as TResult,
21 )
22}
23
24export function useMutationState<TResult = MutationState>(
25 options: MutationStateOptions<TResult> = {},

Callers 1

useMutationStateFunction · 0.70

Calls 1

findAllMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…