esoftplay 0.0.117-a → 0.0.117-d

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 +4 -4
  2. package/package.json +1 -1
package/global.ts CHANGED
@@ -51,7 +51,9 @@ export default function useGlobalState<T>(initValue: T, o?: useGlobalOption): us
51
51
  rehidryte(o.persistKey, (p) => {
52
52
  if (typeof p == 'string') {
53
53
  if (p.startsWith("{") || p.startsWith("["))
54
- set(JSON.parse(p))
54
+ try {
55
+ set(JSON.parse(p))
56
+ } catch (error) { }
55
57
  else {
56
58
  set(p);
57
59
  }
@@ -158,9 +160,7 @@ function rehidryte(key: string, func: (e: string) => void) {
158
160
  debounce(() => {
159
161
  AsyncStorage.multiGet(Object.keys(persistKeys), (e, v) => {
160
162
  if (v && !e) {
161
- v.forEach((iv, i) => {
162
- persistKeys[iv[0]]?.(iv[1])
163
- })
163
+ v.forEach((iv, i) => { persistKeys[iv[0]]?.(iv[1]) })
164
164
  _global.useGlobalStateReady = 1
165
165
  } else {
166
166
  _global.useGlobalStateReady = 1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "esoftplay",
3
- "version": "0.0.117-a",
3
+ "version": "0.0.117-d",
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",