( data: TData | undefined, options: QueryOptions<TQueryFnData, TError, TData, TQueryKey>, )
| 690 | } |
| 691 | |
| 692 | export function fetchState< |
| 693 | TQueryFnData, |
| 694 | TError, |
| 695 | TData, |
| 696 | TQueryKey extends QueryKey, |
| 697 | >( |
| 698 | data: TData | undefined, |
| 699 | options: QueryOptions<TQueryFnData, TError, TData, TQueryKey>, |
| 700 | ) { |
| 701 | return { |
| 702 | fetchFailureCount: 0, |
| 703 | fetchFailureReason: null, |
| 704 | fetchStatus: canFetch(options.networkMode) ? 'fetching' : 'paused', |
| 705 | ...(data === undefined && |
| 706 | ({ |
| 707 | error: null, |
| 708 | status: 'pending', |
| 709 | } as const)), |
| 710 | } as const |
| 711 | } |
| 712 | |
| 713 | function getDefaultState< |
| 714 | TQueryFnData, |
no test coverage detected
searching dependent graphs…