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

Function getResult

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

Source from the content-addressed store, hash-verified

64}
65
66function getResult<
67 TResult = MutationState,
68 TMutation extends Mutation<any, any, any, any> =
69 MutationTypeFromResult<TResult>,
70>(
71 mutationCache: MutationCache,
72 options: MutationStateOptions<TResult, TMutation>,
73): Array<TResult> {
74 return mutationCache
75 .findAll(options.filters)
76 .map(
77 (mutation): TResult =>
78 (options.select
79 ? options.select(mutation as TMutation)
80 : mutation.state) as TResult,
81 )
82}
83
84/**
85 * `useMutationState` is a hook that gives you access to all mutations in the `MutationCache`. You can pass

Callers 1

useMutationStateFunction · 0.70

Calls 1

findAllMethod · 0.45

Tested by

no test coverage detected