( mutationCache: MutationCache, options: MutationStateOptions<TResult, TMutation>, )
| 43 | } |
| 44 | |
| 45 | function 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 | |
| 63 | export function useMutationState< |
| 64 | TResult = MutationState, |
no test coverage detected