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

Function getResult

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

Source from the content-addressed store, hash-verified

62}
63
64function getResult<
65 TResult = MutationState,
66 TMutation extends Mutation<any, any, any, any> =
67 MutationTypeFromResult<TResult>,
68>(
69 mutationCache: MutationCache,
70 options: MutationStateOptions<TResult, TMutation>,
71): Array<TResult> {
72 return mutationCache
73 .findAll(options.filters)
74 .map(
75 (mutation): TResult =>
76 (options.select
77 ? options.select(mutation as TMutation)
78 : mutation.state) as TResult,
79 )
80}
81
82/**
83 * `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