( data: TData | undefined, options: QueryOptions<TQueryFnData, TError, TData, TQueryKey>, )
| 712 | } |
| 713 | |
| 714 | export function fetchState< |
| 715 | TQueryFnData, |
| 716 | TError, |
| 717 | TData, |
| 718 | TQueryKey extends QueryKey, |
| 719 | >( |
| 720 | data: TData | undefined, |
| 721 | options: QueryOptions<TQueryFnData, TError, TData, TQueryKey>, |
| 722 | ) { |
| 723 | return { |
| 724 | fetchFailureCount: 0, |
| 725 | fetchFailureReason: null, |
| 726 | fetchStatus: canFetch(options.networkMode) ? 'fetching' : 'paused', |
| 727 | ...(data === undefined && |
| 728 | ({ |
| 729 | error: null, |
| 730 | status: 'pending', |
| 731 | } as const)), |
| 732 | } as const |
| 733 | } |
| 734 | |
| 735 | function successState<TData>(data: TData | undefined, dataUpdatedAt?: number) { |
| 736 | return { |
no test coverage detected