( mutationCache: MutationCache, options: MutationStateOptions<TResult, TMutation>, )
| 62 | } |
| 63 | |
| 64 | function 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 |
no test coverage detected