@tanstack/vue-query 4.29.7 → 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.
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
return typeof value === 'number' && value >= 0 && value !== Infinity;
|
|
48
48
|
}
|
|
49
49
|
function difference(array1, array2) {
|
|
50
|
-
return array1.filter(x => array2.
|
|
50
|
+
return array1.filter(x => !array2.includes(x));
|
|
51
51
|
}
|
|
52
52
|
function replaceAt(array, index, value) {
|
|
53
53
|
const copy = array.slice(0);
|
|
@@ -437,6 +437,7 @@
|
|
|
437
437
|
}
|
|
438
438
|
const focusManager = new FocusManager();
|
|
439
439
|
|
|
440
|
+
const onlineEvents = ['online', 'offline'];
|
|
440
441
|
class OnlineManager extends Subscribable {
|
|
441
442
|
constructor() {
|
|
442
443
|
super();
|
|
@@ -448,12 +449,14 @@
|
|
|
448
449
|
const listener = () => onOnline(); // Listen to online
|
|
449
450
|
|
|
450
451
|
|
|
451
|
-
|
|
452
|
-
|
|
452
|
+
onlineEvents.forEach(event => {
|
|
453
|
+
window.addEventListener(event, listener, false);
|
|
454
|
+
});
|
|
453
455
|
return () => {
|
|
454
456
|
// Be sure to unsubscribe if a new handler is set
|
|
455
|
-
|
|
456
|
-
|
|
457
|
+
onlineEvents.forEach(event => {
|
|
458
|
+
window.removeEventListener(event, listener);
|
|
459
|
+
});
|
|
457
460
|
};
|
|
458
461
|
}
|
|
459
462
|
|
|
@@ -929,7 +932,7 @@
|
|
|
929
932
|
}
|
|
930
933
|
|
|
931
934
|
addObserver(observer) {
|
|
932
|
-
if (this.observers.
|
|
935
|
+
if (!this.observers.includes(observer)) {
|
|
933
936
|
this.observers.push(observer); // Stop the query from being garbage collected
|
|
934
937
|
|
|
935
938
|
this.clearGcTimeout();
|
|
@@ -942,7 +945,7 @@
|
|
|
942
945
|
}
|
|
943
946
|
|
|
944
947
|
removeObserver(observer) {
|
|
945
|
-
if (this.observers.
|
|
948
|
+
if (this.observers.includes(observer)) {
|
|
946
949
|
this.observers = this.observers.filter(x => x !== observer);
|
|
947
950
|
|
|
948
951
|
if (!this.observers.length) {
|
|
@@ -1427,7 +1430,7 @@
|
|
|
1427
1430
|
}
|
|
1428
1431
|
|
|
1429
1432
|
addObserver(observer) {
|
|
1430
|
-
if (this.observers.
|
|
1433
|
+
if (!this.observers.includes(observer)) {
|
|
1431
1434
|
this.observers.push(observer); // Stop the mutation from being garbage collected
|
|
1432
1435
|
|
|
1433
1436
|
this.clearGcTimeout();
|