@tanstack/vue-query 4.35.1 → 4.35.3

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.
@@ -1020,8 +1020,8 @@
1020
1020
  }
1021
1021
  }
1022
1022
 
1023
- if (!Array.isArray(this.options.queryKey)) {
1024
- {
1023
+ {
1024
+ if (!Array.isArray(this.options.queryKey)) {
1025
1025
  this.logger.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']");
1026
1026
  }
1027
1027
  }
@@ -1218,7 +1218,8 @@
1218
1218
  const error = action.error;
1219
1219
 
1220
1220
  if (isCancelledError(error) && error.revert && this.revertState) {
1221
- return { ...this.revertState
1221
+ return { ...this.revertState,
1222
+ fetchStatus: 'idle'
1222
1223
  };
1223
1224
  }
1224
1225
 
@@ -4852,9 +4853,7 @@
4852
4853
  };
4853
4854
 
4854
4855
  run();
4855
- stopWatch = vueDemi.watch(defaultedOptions, run, {
4856
- deep: true
4857
- });
4856
+ stopWatch = vueDemi.watch(defaultedOptions, run);
4858
4857
  });
4859
4858
  }; // Handle error boundary
4860
4859
 
@@ -5048,15 +5047,14 @@
5048
5047
 
5049
5048
  const filters = vueDemi.computed(() => parseFilterArgs$1(arg1, arg2));
5050
5049
  const queryClient = (_filters$value$queryC = filters.value.queryClient) != null ? _filters$value$queryC : useQueryClient(filters.value.queryClientKey);
5051
- const isFetching = vueDemi.ref(queryClient.isFetching(filters));
5052
- const unsubscribe = queryClient.getQueryCache().subscribe(() => {
5053
- isFetching.value = queryClient.isFetching(filters);
5054
- });
5055
- vueDemi.watch(filters, () => {
5050
+ const isFetching = vueDemi.ref();
5051
+
5052
+ const listener = () => {
5056
5053
  isFetching.value = queryClient.isFetching(filters);
5057
- }, {
5058
- flush: 'sync'
5059
- });
5054
+ };
5055
+
5056
+ const unsubscribe = queryClient.getQueryCache().subscribe(listener);
5057
+ vueDemi.watchSyncEffect(listener);
5060
5058
  vueDemi.onScopeDispose(() => {
5061
5059
  unsubscribe();
5062
5060
  });
@@ -5090,15 +5088,14 @@
5090
5088
 
5091
5089
  const filters = vueDemi.computed(() => parseFilterArgs(arg1, arg2));
5092
5090
  const queryClient = (_filters$value$queryC = filters.value.queryClient) != null ? _filters$value$queryC : useQueryClient(filters.value.queryClientKey);
5093
- const isMutating = vueDemi.ref(queryClient.isMutating(filters));
5094
- const unsubscribe = queryClient.getMutationCache().subscribe(() => {
5095
- isMutating.value = queryClient.isMutating(filters);
5096
- });
5097
- vueDemi.watch(filters, () => {
5091
+ const isMutating = vueDemi.ref();
5092
+
5093
+ const listener = () => {
5098
5094
  isMutating.value = queryClient.isMutating(filters);
5099
- }, {
5100
- flush: 'sync'
5101
- });
5095
+ };
5096
+
5097
+ const unsubscribe = queryClient.getMutationCache().subscribe(listener);
5098
+ vueDemi.watchSyncEffect(listener);
5102
5099
  vueDemi.onScopeDispose(() => {
5103
5100
  unsubscribe();
5104
5101
  });