@dxos/react-client 2.28.2-dev.8a42e72c → 2.28.2-dev.e1efc380

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/react-client",
3
- "version": "2.28.2-dev.8a42e72c",
3
+ "version": "2.28.2-dev.e1efc380",
4
4
  "description": "React client API",
5
5
  "keywords": [],
6
6
  "license": "MIT",
@@ -8,23 +8,23 @@
8
8
  "main": "dist/src/index.js",
9
9
  "types": "dist/src/index.d.ts",
10
10
  "dependencies": {
11
- "@dxos/async": "2.28.2-dev.8a42e72c",
12
- "@dxos/bot-factory-client": "2.28.2-dev.8a42e72c",
13
- "@dxos/client": "2.28.2-dev.8a42e72c",
14
- "@dxos/config": "2.28.2-dev.8a42e72c",
15
- "@dxos/credentials": "2.28.2-dev.8a42e72c",
16
- "@dxos/crypto": "2.28.2-dev.8a42e72c",
17
- "@dxos/debug": "2.28.2-dev.8a42e72c",
18
- "@dxos/echo-db": "2.28.2-dev.8a42e72c",
19
- "@dxos/network-manager": "2.28.2-dev.8a42e72c",
20
- "@dxos/util": "2.28.2-dev.8a42e72c",
11
+ "@dxos/async": "2.28.2-dev.e1efc380",
12
+ "@dxos/bot-factory-client": "2.28.2-dev.e1efc380",
13
+ "@dxos/client": "2.28.2-dev.e1efc380",
14
+ "@dxos/config": "2.28.2-dev.e1efc380",
15
+ "@dxos/credentials": "2.28.2-dev.e1efc380",
16
+ "@dxos/crypto": "2.28.2-dev.e1efc380",
17
+ "@dxos/debug": "2.28.2-dev.e1efc380",
18
+ "@dxos/echo-db": "2.28.2-dev.e1efc380",
19
+ "@dxos/network-manager": "2.28.2-dev.e1efc380",
20
+ "@dxos/util": "2.28.2-dev.e1efc380",
21
21
  "assert": "^2.0.0",
22
22
  "debug": "^4.3.3",
23
23
  "react-display-name": "^0.2.5",
24
24
  "use-subscription": "^1.4.1"
25
25
  },
26
26
  "devDependencies": {
27
- "@dxos/esbuild-plugins": "2.28.2-dev.8a42e72c",
27
+ "@dxos/esbuild-plugins": "2.28.2-dev.e1efc380",
28
28
  "@dxos/toolchain-node-library": "2.28.1",
29
29
  "@mui/material": "^5.4.2",
30
30
  "@testing-library/react": "^11.0.4",
@@ -22,12 +22,12 @@ export const useSelection = <T extends Entity<any>> (
22
22
  selection: Selection<T> | SelectionResult<T> | Falsy,
23
23
  deps: readonly any[] = []
24
24
  ): T[] | undefined => {
25
- const [result, setResult] = useState(() => coerseSelection(selection));
25
+ const [result, setResult] = useState(() => coerceSelection(selection));
26
26
  const [data, setData] = useState(() => result ? result.result : undefined);
27
27
 
28
28
  // Update selection when the query or customs deps change.
29
29
  useEffect(() => {
30
- const newResult = coerseSelection(selection);
30
+ const newResult = coerceSelection(selection);
31
31
  const newData = newResult?.result;
32
32
  setResult(newResult);
33
33
  setData(newData);
@@ -45,8 +45,6 @@ export const useSelection = <T extends Entity<any>> (
45
45
  return data;
46
46
  };
47
47
 
48
- // TODO(burdon): Typo (coerce).
49
- const coerseSelection = <T extends Entity>(arg: Selection<T> | SelectionResult<T> | Falsy): SelectionResult<T> | undefined =>
50
- !arg ? undefined
51
- : arg instanceof Selection ? arg.query()
52
- : arg;
48
+ const coerceSelection = <T extends Entity>(
49
+ arg: Selection<T> | SelectionResult<T> | Falsy
50
+ ): SelectionResult<T> | undefined => !arg ? undefined : arg instanceof Selection ? arg.query() : arg;
@@ -7,5 +7,5 @@ import { Client } from '@dxos/client';
7
7
  import { useInvitations } from './useInvitations';
8
8
 
9
9
  export const useHaloInvitations = (client: Client) => {
10
- return useInvitations(client.halo);
10
+ return useInvitations(client.halo.invitationProxy);
11
11
  };
@@ -9,5 +9,5 @@ import { useInvitations } from './useInvitations';
9
9
 
10
10
  export const usePartyInvitations = (partyKey?: PublicKey) => {
11
11
  const party = useParty(partyKey);
12
- return useInvitations(party);
12
+ return useInvitations(party?.invitationProxy);
13
13
  };