@tanstack/react-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.
|
@@ -461,6 +461,7 @@
|
|
|
461
461
|
}
|
|
462
462
|
const focusManager = new FocusManager();
|
|
463
463
|
|
|
464
|
+
const onlineEvents = ['online', 'offline'];
|
|
464
465
|
class OnlineManager extends Subscribable {
|
|
465
466
|
constructor() {
|
|
466
467
|
super();
|
|
@@ -472,12 +473,14 @@
|
|
|
472
473
|
const listener = () => onOnline(); // Listen to online
|
|
473
474
|
|
|
474
475
|
|
|
475
|
-
|
|
476
|
-
|
|
476
|
+
onlineEvents.forEach(event => {
|
|
477
|
+
window.addEventListener(event, listener, false);
|
|
478
|
+
});
|
|
477
479
|
return () => {
|
|
478
480
|
// Be sure to unsubscribe if a new handler is set
|
|
479
|
-
|
|
480
|
-
|
|
481
|
+
onlineEvents.forEach(event => {
|
|
482
|
+
window.removeEventListener(event, listener);
|
|
483
|
+
});
|
|
481
484
|
};
|
|
482
485
|
}
|
|
483
486
|
|