@rpcbase/client 0.133.0 → 0.135.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/auth/getUid.js CHANGED
@@ -1,11 +1,11 @@
1
1
  /* @flow */
2
2
  import {Platform} from "react-native"
3
3
 
4
- import {getUid} from "./index"
4
+ import {privateGetUid} from "./index"
5
5
 
6
- const getUidFn = Platform.OS === "web" ? getUid : () => {
6
+ const getUid = Platform.OS === "web" ? privateGetUid : () => {
7
7
  console.warn("native should not call getUid, use userId from AuthContext")
8
8
  return null
9
9
  }
10
10
 
11
- export default getUidFn
11
+ export default getUid
package/auth/index.js CHANGED
@@ -4,7 +4,7 @@ import {Platform} from "react-native"
4
4
  import isHexadecimal from "validator/lib/isHexadecimal"
5
5
 
6
6
  import storage from "../storage"
7
- import {disconnect as rts_disconnect} from "../rts"
7
+ import {disconnect as rts_disconnect} from "../rts/rts"
8
8
  import post from "../helpers/post"
9
9
 
10
10
  import redirect_sign_in from "./helpers/redirect_sign_in"
@@ -111,7 +111,7 @@ export const session_restrict = (ctx, next) => {
111
111
  }
112
112
 
113
113
 
114
- export const getUid = () => __user_id
114
+ export const privateGetUid = () => __user_id
115
115
  export const setUid = (val) => {
116
116
  __user_id = val
117
117
 
@@ -3,7 +3,7 @@ import {useEffect, useState, useRef, useCallback} from "react"
3
3
  import _throttle from "lodash/throttle"
4
4
  import isEqual from "fast-deep-equal/react"
5
5
 
6
- import {getUid} from "../../auth"
6
+ import getUid from "../../auth/getUid"
7
7
  import storage from "../../storage"
8
8
 
9
9
  import batchedGetStoredValues from "./batchedGetStoredValues"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rpcbase/client",
3
- "version": "0.133.0",
3
+ "version": "0.135.0",
4
4
  "scripts": {
5
5
  "build-firebase": "webpack -c firebase/webpack.config.js",
6
6
  "build": "yarn build-firebase",
package/rts/index.js CHANGED
@@ -1,2 +1,10 @@
1
1
  /* @flow */
2
- export * from "./rts"
2
+ import {register_query} from "./rts"
3
+ import getUseDocument from "./getUseDocument"
4
+ import getUseQuery from "./getUseQuery"
5
+
6
+ export const useQuery = getUseQuery(register_query)
7
+
8
+ export const useDocument = getUseDocument(register_query)
9
+
10
+ export {register_query}
package/rts/rts.js CHANGED
@@ -10,8 +10,6 @@ import getBaseUrl from "../getBaseUrl"
10
10
  import getTenantId from "../auth/getTenantId"
11
11
 
12
12
  import store from "./store"
13
- import getUseDocument from "./getUseDocument"
14
- import getUseQuery from "./getUseQuery"
15
13
 
16
14
  const log = debug("rb:socket")
17
15
 
@@ -222,8 +220,3 @@ export const register_query = (model_name, query, _options, _callback) => {
222
220
  }
223
221
  }
224
222
  }
225
-
226
-
227
- export const useQuery = getUseQuery(register_query)
228
-
229
- export const useDocument = getUseDocument(register_query)