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

Function getResult

packages/react-query/src/useMutationState.ts:45–61  ·  view source on GitHub ↗
(
  mutationCache: MutationCache,
  options: MutationStateOptions<TResult, TMutation>,
)

Source from the content-addressed store, hash-verified

43}
44
45function getResult<
46 TResult = MutationState,
47 TMutation extends Mutation<any, any, any, any> =
48 MutationTypeFromResult<TResult>,
49>(
50 mutationCache: MutationCache,
51 options: MutationStateOptions<TResult, TMutation>,
52): Array<TResult> {
53 return mutationCache
54 .findAll(options.filters)
55 .map(
56 (mutation): TResult =>
57 (options.select
58 ? options.select(mutation as TMutation)
59 : mutation.state) as TResult,
60 )
61}
62
63export function useMutationState<
64 TResult = MutationState,

Callers 1

useMutationStateFunction · 0.70

Calls 1

findAllMethod · 0.45

Tested by

no test coverage detected