@omnifyjp/ts 8.1.1 → 8.1.2
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.
|
@@ -116,9 +116,12 @@ export function setupFocusManager(): () => void {
|
|
|
116
116
|
/**
|
|
117
117
|
* Call once at app startup to wire NetInfo → TanStack Query onlineManager.
|
|
118
118
|
* Queries pause when the device loses connectivity and resume when it's back.
|
|
119
|
+
*
|
|
120
|
+
* Returns nothing: TanStack Query v5's \`setEventListener\` is void and owns
|
|
121
|
+
* the unsubscribe itself (issue #331).
|
|
119
122
|
*/
|
|
120
|
-
export function setupOnlineManager():
|
|
121
|
-
|
|
123
|
+
export function setupOnlineManager(): void {
|
|
124
|
+
onlineManager.setEventListener((setOnline) => {
|
|
122
125
|
return NetInfo.addEventListener((state) => {
|
|
123
126
|
setOnline(!!state.isConnected);
|
|
124
127
|
});
|