( data: TData | undefined, options: QueryOptions<TQueryFnData, TError, TData, TQueryKey>, )
| 905 | } |
| 906 | |
| 907 | export function fetchState< |
| 908 | TQueryFnData, |
| 909 | TError, |
| 910 | TData, |
| 911 | TQueryKey extends QueryKey, |
| 912 | >( |
| 913 | data: TData | undefined, |
| 914 | options: QueryOptions<TQueryFnData, TError, TData, TQueryKey>, |
| 915 | ) { |
| 916 | return { |
| 917 | fetchFailureCount: 0, |
| 918 | fetchFailureReason: null, |
| 919 | fetchStatus: canFetch(options.networkMode) ? 'fetching' : 'paused', |
| 920 | ...(data === undefined && |
| 921 | ({ |
| 922 | error: null, |
| 923 | status: 'pending', |
| 924 | } as const)), |
| 925 | } as const |
| 926 | } |
| 927 | |
| 928 | function successState<TData>(data: TData | undefined, dataUpdatedAt?: number) { |
| 929 | return { |
no test coverage detected