@tanstack/react-query 4.7.2 → 4.9.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.
@@ -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: status === 'loading',
2512
+ isLoading,
2511
2513
  isSuccess: status === 'success',
2512
- isError: status === 'error',
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: isFetching,
2522
- isRefetching: isFetching && status !== 'loading',
2523
- isLoadingError: status === 'error' && state.dataUpdatedAt === 0,
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: status === 'error' && state.dataUpdatedAt !== 0,
2530
+ isRefetchError: isError && state.dataUpdatedAt !== 0,
2528
2531
  isStale: isStale(query, options),
2529
2532
  refetch: this.refetch,
2530
2533
  remove: this.remove