@tanstack/vue-query 4.29.7 → 4.29.10
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.
|
@@ -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
|
|