@rpcbase/client 0.64.0 → 0.66.0

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.
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@rpcbase/client",
3
- "version": "0.64.0",
3
+ "version": "0.66.0",
4
4
  "scripts": {
5
5
  "test": "jest"
6
6
  },
7
7
  "dependencies": {
8
8
  "axios": "1.4.0",
9
- "i18next": "23.4.1",
9
+ "i18next": "23.4.2",
10
10
  "i18next-chained-backend": "4.4.0",
11
11
  "i18next-resources-to-backend": "1.1.4",
12
12
  "lodash": "4.17.21",
@@ -8,8 +8,6 @@ import _omit from "lodash/omit"
8
8
 
9
9
  import get_uid from "../auth/get_uid"
10
10
 
11
- // import cacheStorage from "./cacheStorage"
12
-
13
11
 
14
12
  const log = debug("rb:rts:useQuery")
15
13
 
@@ -53,21 +51,6 @@ const getUseQuery = (register_query) => (
53
51
  }
54
52
  }, [])
55
53
 
56
- // useEffect(() => {
57
- // const load = async() => {
58
- // const val = await cacheStorage.get(storageKey)
59
- // // TODO: rm this
60
- // // always initially apply when first load here
61
- // if (val) {
62
- // console.log("Will set val from cache storage")
63
- // setData(val)
64
- // setLoading(false)
65
- // }
66
- // }
67
- //
68
- // load()
69
- // }, [storageKey])
70
-
71
54
  const applyNewData = (newData, context) => {
72
55
  setData(newData)
73
56
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  const getEmptyStorage = () => {
4
4
 
5
- const cacheStorage = {
5
+ const storage = {
6
6
  get: async(key) => {
7
7
  },
8
8
  set: async(key, obj) => {
@@ -11,7 +11,7 @@ const getEmptyStorage = () => {
11
11
  },
12
12
  }
13
13
 
14
- return cacheStorage
14
+ return storage
15
15
  }
16
16
 
17
17
 
@@ -1,8 +1,8 @@
1
1
  /* @flow */
2
2
  import AsyncStorage from "@react-native-async-storage/async-storage"
3
3
 
4
- const getNativeStorage = () => {
5
- const cacheStorage = {
4
+ const getStorage = () => {
5
+ const storage = {
6
6
  get: async(key) => {
7
7
  try {
8
8
  const res = await AsyncStorage.getItem(key)
@@ -21,8 +21,8 @@ const getNativeStorage = () => {
21
21
  }
22
22
  }
23
23
 
24
- return cacheStorage
24
+ return storage
25
25
  }
26
26
 
27
27
 
28
- export default getNativeStorage()
28
+ export default getStorage()
@@ -2,8 +2,8 @@
2
2
  const storeName = "store"
3
3
  const version = 1
4
4
 
5
- const getWebStorage = (
6
- dbName = "rb-query-cache"
5
+ const getStorage = (
6
+ dbName = "rb-store"
7
7
  ) => {
8
8
  let __db
9
9
 
@@ -28,7 +28,7 @@ const getWebStorage = (
28
28
  }
29
29
 
30
30
 
31
- const cacheStorage = {
31
+ const storage = {
32
32
  get: (key) => new Promise((resolve, reject) => {
33
33
  const transaction = __db.transaction([storeName], "readonly")
34
34
  const objectStore = transaction.objectStore(storeName)
@@ -78,8 +78,8 @@ const getWebStorage = (
78
78
  }),
79
79
  }
80
80
 
81
- return cacheStorage
81
+ return storage
82
82
  }
83
83
 
84
84
 
85
- export default getWebStorage()
85
+ export default getStorage()