esoftplay 0.0.180 → 0.0.181

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.
Files changed (2) hide show
  1. package/global.ts +6 -0
  2. package/package.json +1 -1
package/global.ts CHANGED
@@ -81,6 +81,7 @@ export default function useGlobalState<T>(initValue: T, o?: useGlobalOption): us
81
81
  if (o?.useAutoSync) {
82
82
  const LibCurl = esp.mod("lib/curl")
83
83
  const UseTasks = esp.mod("use/tasks")
84
+
84
85
  taskSync = UseTasks()((item) => new Promise((next) => {
85
86
  const debounce = createDebounce()
86
87
  const delayInMs = o?.useAutoSync?.delayInMs || 0
@@ -110,6 +111,11 @@ export default function useGlobalState<T>(initValue: T, o?: useGlobalOption): us
110
111
  }), () => {
111
112
  o?.useAutoSync?.isSyncing?.(false)
112
113
  })
114
+ esp.mod("lib/net_status").subscriber.useSubscribe(({ isInternetReachable, isOnline }) => {
115
+ if (isInternetReachable && isOnline) {
116
+ _sync()
117
+ }
118
+ })
113
119
  }
114
120
 
115
121
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "esoftplay",
3
- "version": "0.0.180",
3
+ "version": "0.0.181",
4
4
  "description": "embedding data from esoftplay framework (web based) into mobile app",
5
5
  "main": "cache/index.js",
6
6
  "types": "../../index.d.ts",