@tanstack/react-query 4.7.2 → 4.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/umd/index.development.js +9 -6
- package/build/umd/index.development.js.map +1 -1
- package/build/umd/index.production.js +1 -1
- package/build/umd/index.production.js.map +1 -1
- package/package.json +4 -4
- package/src/__tests__/useInfiniteQuery.test.tsx +2 -0
- package/src/__tests__/useQuery.test.tsx +5 -0
|
@@ -2504,12 +2504,15 @@
|
|
|
2504
2504
|
}
|
|
2505
2505
|
|
|
2506
2506
|
const isFetching = fetchStatus === 'fetching';
|
|
2507
|
+
const isLoading = status === 'loading';
|
|
2508
|
+
const isError = status === 'error';
|
|
2507
2509
|
const result = {
|
|
2508
2510
|
status,
|
|
2509
2511
|
fetchStatus,
|
|
2510
|
-
isLoading
|
|
2512
|
+
isLoading,
|
|
2511
2513
|
isSuccess: status === 'success',
|
|
2512
|
-
isError
|
|
2514
|
+
isError,
|
|
2515
|
+
isInitialLoading: isLoading && isFetching,
|
|
2513
2516
|
data,
|
|
2514
2517
|
dataUpdatedAt,
|
|
2515
2518
|
error,
|
|
@@ -2518,13 +2521,13 @@
|
|
|
2518
2521
|
errorUpdateCount: state.errorUpdateCount,
|
|
2519
2522
|
isFetched: state.dataUpdateCount > 0 || state.errorUpdateCount > 0,
|
|
2520
2523
|
isFetchedAfterMount: state.dataUpdateCount > queryInitialState.dataUpdateCount || state.errorUpdateCount > queryInitialState.errorUpdateCount,
|
|
2521
|
-
isFetching
|
|
2522
|
-
isRefetching: isFetching &&
|
|
2523
|
-
isLoadingError:
|
|
2524
|
+
isFetching,
|
|
2525
|
+
isRefetching: isFetching && !isLoading,
|
|
2526
|
+
isLoadingError: isError && state.dataUpdatedAt === 0,
|
|
2524
2527
|
isPaused: fetchStatus === 'paused',
|
|
2525
2528
|
isPlaceholderData,
|
|
2526
2529
|
isPreviousData,
|
|
2527
|
-
isRefetchError:
|
|
2530
|
+
isRefetchError: isError && state.dataUpdatedAt !== 0,
|
|
2528
2531
|
isStale: isStale(query, options),
|
|
2529
2532
|
refetch: this.refetch,
|
|
2530
2533
|
remove: this.remove
|