@dxos/app-graph 0.8.1 → 0.8.2-main.2f9c567

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/src/node.ts CHANGED
@@ -41,10 +41,10 @@ export type Node<TData = any, TProperties extends Record<string, any> = Record<s
41
41
  data: TData;
42
42
  }>;
43
43
 
44
- export type NodeFilter<T = any, U extends Record<string, any> = Record<string, any>> = (
44
+ export type NodeFilter<TData = any, TProperties extends Record<string, any> = Record<string, any>> = (
45
45
  node: Node<unknown, Record<string, any>>,
46
46
  connectedNode: Node,
47
- ) => node is Node<T, U>;
47
+ ) => node is Node<TData, TProperties>;
48
48
 
49
49
  export type Relation = 'outbound' | 'inbound';
50
50
 
@@ -8,16 +8,16 @@ import { Pause, Play, Plus, Timer } from '@phosphor-icons/react';
8
8
  import React, { useEffect, useState } from 'react';
9
9
 
10
10
  import {
11
- create,
11
+ live,
12
12
  isSpace,
13
13
  type Echo,
14
14
  type FilterSource,
15
- type ReactiveEchoObject,
16
15
  type Space,
17
16
  SpaceState,
18
17
  type QueryOptions,
19
18
  type Query,
20
19
  } from '@dxos/client/echo';
20
+ import type { BaseObject } from '@dxos/echo-schema';
21
21
  import { faker } from '@dxos/random';
22
22
  import { type Client, useClient } from '@dxos/react-client';
23
23
  import { withClientProvider } from '@dxos/react-client/testing';
@@ -54,7 +54,7 @@ const actionWeights = {
54
54
  };
55
55
 
56
56
  // TODO(wittjosiah): Factor out.
57
- const memoizeQuery = <T extends ReactiveEchoObject<any>>(
57
+ const memoizeQuery = <T extends BaseObject>(
58
58
  spaceOrEcho?: Space | Echo,
59
59
  filter?: FilterSource<T>,
60
60
  options?: QueryOptions,
@@ -160,7 +160,7 @@ const runAction = async (client: Client, action: Action) => {
160
160
  }
161
161
 
162
162
  case Action.ADD_OBJECT:
163
- getRandomSpace(client)?.db.add(create({ type: 'test', name: faker.commerce.productName() }));
163
+ getRandomSpace(client)?.db.add(live({ type: 'test', name: faker.commerce.productName() }));
164
164
  break;
165
165
 
166
166
  case Action.REMOVE_OBJECT: {