( mutationCache: MutationCache, options: MutationStateOptions<TResult, TMutation>, )
| 31 | } |
| 32 | |
| 33 | function getResult< |
| 34 | TResult = MutationState, |
| 35 | TMutation extends Mutation<any, any, any, any> = |
| 36 | MutationTypeFromResult<TResult>, |
| 37 | >( |
| 38 | mutationCache: MutationCache, |
| 39 | options: MutationStateOptions<TResult, TMutation>, |
| 40 | ): Array<TResult> { |
| 41 | return mutationCache |
| 42 | .findAll(options.filters) |
| 43 | .map( |
| 44 | (mutation): TResult => |
| 45 | (options.select |
| 46 | ? options.select(mutation as TMutation) |
| 47 | : mutation.state) as TResult, |
| 48 | ) |
| 49 | } |
| 50 | |
| 51 | export function useMutationState< |
| 52 | TResult = MutationState, |
no test coverage detected