@tanstack/react-query 4.29.10 → 4.29.11

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.
@@ -71,7 +71,7 @@
71
71
  return typeof value === 'number' && value >= 0 && value !== Infinity;
72
72
  }
73
73
  function difference(array1, array2) {
74
- return array1.filter(x => array2.indexOf(x) === -1);
74
+ return array1.filter(x => !array2.includes(x));
75
75
  }
76
76
  function replaceAt(array, index, value) {
77
77
  const copy = array.slice(0);
@@ -956,7 +956,7 @@
956
956
  }
957
957
 
958
958
  addObserver(observer) {
959
- if (this.observers.indexOf(observer) === -1) {
959
+ if (!this.observers.includes(observer)) {
960
960
  this.observers.push(observer); // Stop the query from being garbage collected
961
961
 
962
962
  this.clearGcTimeout();
@@ -969,7 +969,7 @@
969
969
  }
970
970
 
971
971
  removeObserver(observer) {
972
- if (this.observers.indexOf(observer) !== -1) {
972
+ if (this.observers.includes(observer)) {
973
973
  this.observers = this.observers.filter(x => x !== observer);
974
974
 
975
975
  if (!this.observers.length) {
@@ -1454,7 +1454,7 @@
1454
1454
  }
1455
1455
 
1456
1456
  addObserver(observer) {
1457
- if (this.observers.indexOf(observer) === -1) {
1457
+ if (!this.observers.includes(observer)) {
1458
1458
  this.observers.push(observer); // Stop the mutation from being garbage collected
1459
1459
 
1460
1460
  this.clearGcTimeout();