@dxos/app-graph 0.8.4-main.fd6878d → 0.8.4-main.fffef41

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.
@@ -1,8 +1,10 @@
1
1
  import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
2
 
3
3
  // src/graph.ts
4
- import { Registry, Rx } from "@effect-rx/rx-react";
5
- import { Option, Record, pipe } from "effect";
4
+ import { Atom, Registry } from "@effect-atom/atom-react";
5
+ import * as Function from "effect/Function";
6
+ import * as Option from "effect/Option";
7
+ import * as Record from "effect/Record";
6
8
  import { Event, Trigger } from "@dxos/async";
7
9
  import { todo } from "@dxos/debug";
8
10
  import { invariant } from "@dxos/invariant";
@@ -14,7 +16,7 @@ var getGraph = (node) => {
14
16
  const graph = node[graphSymbol];
15
17
  invariant(graph, "Node is not associated with a graph.", {
16
18
  F: __dxlog_file,
17
- L: 25,
19
+ L: 29,
18
20
  S: void 0,
19
21
  A: [
20
22
  "graph",
@@ -48,16 +50,16 @@ var Graph = class {
48
50
  ]
49
51
  ]);
50
52
  /** @internal */
51
- _node = Rx.family((id) => {
53
+ _node = Atom.family((id) => {
52
54
  const initial = Option.flatten(Record.get(this._initialNodes, id));
53
- return Rx.make(initial).pipe(Rx.keepAlive, Rx.withLabel(`graph:node:${id}`));
55
+ return Atom.make(initial).pipe(Atom.keepAlive, Atom.withLabel(`graph:node:${id}`));
54
56
  });
55
- _nodeOrThrow = Rx.family((id) => {
56
- return Rx.make((get) => {
57
- const node = get(this._node(id));
57
+ _nodeOrThrow = Atom.family((id) => {
58
+ return Atom.make((get2) => {
59
+ const node = get2(this._node(id));
58
60
  invariant(Option.isSome(node), `Node not available: ${id}`, {
59
61
  F: __dxlog_file,
60
- L: 252,
62
+ L: 267,
61
63
  S: this,
62
64
  A: [
63
65
  "Option.isSome(node)",
@@ -67,33 +69,33 @@ var Graph = class {
67
69
  return node.value;
68
70
  });
69
71
  });
70
- _edges = Rx.family((id) => {
72
+ _edges = Atom.family((id) => {
71
73
  const initial = Record.get(this._initialEdges, id).pipe(Option.getOrElse(() => ({
72
74
  inbound: [],
73
75
  outbound: []
74
76
  })));
75
- return Rx.make(initial).pipe(Rx.keepAlive, Rx.withLabel(`graph:edges:${id}`));
77
+ return Atom.make(initial).pipe(Atom.keepAlive, Atom.withLabel(`graph:edges:${id}`));
76
78
  });
77
- // NOTE: Currently the argument to the family needs to be referentially stable for the rx to be referentially stable.
78
- // TODO(wittjosiah): Rx feature request, support for something akin to `ComplexMap` to allow for complex arguments.
79
- _connections = Rx.family((key) => {
80
- return Rx.make((get) => {
79
+ // NOTE: Currently the argument to the family needs to be referentially stable for the atom to be referentially stable.
80
+ // TODO(wittjosiah): Atom feature request, support for something akin to `ComplexMap` to allow for complex arguments.
81
+ _connections = Atom.family((key) => {
82
+ return Atom.make((get2) => {
81
83
  const [id, relation] = key.split("$");
82
- const edges = get(this._edges(id));
83
- return edges[relation].map((id2) => get(this._node(id2))).filter(Option.isSome).map((o) => o.value);
84
- }).pipe(Rx.withLabel(`graph:connections:${key}`));
84
+ const edges = get2(this._edges(id));
85
+ return edges[relation].map((id2) => get2(this._node(id2))).filter(Option.isSome).map((o) => o.value);
86
+ }).pipe(Atom.withLabel(`graph:connections:${key}`));
85
87
  });
86
- _actions = Rx.family((id) => {
87
- return Rx.make((get) => {
88
- return get(this._connections(`${id}$outbound`)).filter((node) => node.type === ACTION_TYPE || node.type === ACTION_GROUP_TYPE);
89
- }).pipe(Rx.withLabel(`graph:actions:${id}`));
88
+ _actions = Atom.family((id) => {
89
+ return Atom.make((get2) => {
90
+ return get2(this._connections(`${id}$outbound`)).filter((node) => node.type === ACTION_TYPE || node.type === ACTION_GROUP_TYPE);
91
+ }).pipe(Atom.withLabel(`graph:actions:${id}`));
90
92
  });
91
- _json = Rx.family((id) => {
92
- return Rx.make((get) => {
93
+ _json = Atom.family((id) => {
94
+ return Atom.make((get2) => {
93
95
  const toJSON = (node, seen = []) => {
94
- const nodes = get(this.connections(node.id));
96
+ const nodes = get2(this.connections(node.id));
95
97
  const obj = {
96
- id: node.id.length > 32 ? `${node.id.slice(0, 32)}...` : node.id,
98
+ id: node.id,
97
99
  type: node.type
98
100
  };
99
101
  if (node.properties.label) {
@@ -110,9 +112,9 @@ var Graph = class {
110
112
  }
111
113
  return obj;
112
114
  };
113
- const root = get(this.nodeOrThrow(id));
115
+ const root = get2(this.nodeOrThrow(id));
114
116
  return toJSON(root);
115
- }).pipe(Rx.withLabel(`graph:json:${id}`));
117
+ }).pipe(Atom.withLabel(`graph:json:${id}`));
116
118
  });
117
119
  constructor({ registry, nodes, edges, onInitialize, onExpand, onRemoveNode } = {}) {
118
120
  this._registry = registry ?? Registry.make();
@@ -176,7 +178,7 @@ var Graph = class {
176
178
  initialized
177
179
  }, {
178
180
  F: __dxlog_file,
179
- L: 384,
181
+ L: 399,
180
182
  S: this,
181
183
  C: (f, a) => f(...a)
182
184
  });
@@ -193,7 +195,7 @@ var Graph = class {
193
195
  expanded
194
196
  }, {
195
197
  F: __dxlog_file,
196
- L: 394,
198
+ L: 409,
197
199
  S: this,
198
200
  C: (f, a) => f(...a)
199
201
  });
@@ -203,14 +205,14 @@ var Graph = class {
203
205
  }
204
206
  }
205
207
  addNodes(nodes) {
206
- Rx.batch(() => {
208
+ Atom.batch(() => {
207
209
  nodes.map((node) => this.addNode(node));
208
210
  });
209
211
  }
210
212
  addNode({ nodes, edges, ...nodeArg }) {
211
213
  const { id, type, data = null, properties = {} } = nodeArg;
212
- const nodeRx = this._node(id);
213
- const node = this._registry.get(nodeRx);
214
+ const nodeAtom = this._node(id);
215
+ const node = this._registry.get(nodeAtom);
214
216
  Option.match(node, {
215
217
  onSome: (node2) => {
216
218
  const typeChanged = node2.type !== type;
@@ -223,7 +225,7 @@ var Graph = class {
223
225
  propertiesChanged
224
226
  }, {
225
227
  F: __dxlog_file,
226
- L: 416,
228
+ L: 431,
227
229
  S: this,
228
230
  C: (f, a) => f(...a)
229
231
  });
@@ -235,7 +237,7 @@ var Graph = class {
235
237
  properties
236
238
  }, {
237
239
  F: __dxlog_file,
238
- L: 418,
240
+ L: 438,
239
241
  S: this,
240
242
  C: (f, a) => f(...a)
241
243
  });
@@ -248,7 +250,7 @@ var Graph = class {
248
250
  ...properties
249
251
  }
250
252
  });
251
- this._registry.set(nodeRx, newNode);
253
+ this._registry.set(nodeAtom, newNode);
252
254
  this.onNodeChanged.emit({
253
255
  id,
254
256
  node: newNode
@@ -263,7 +265,7 @@ var Graph = class {
263
265
  properties
264
266
  }, {
265
267
  F: __dxlog_file,
266
- L: 425,
268
+ L: 450,
267
269
  S: this,
268
270
  C: (f, a) => f(...a)
269
271
  });
@@ -273,7 +275,7 @@ var Graph = class {
273
275
  data,
274
276
  properties
275
277
  });
276
- this._registry.set(nodeRx, newNode);
278
+ this._registry.set(nodeAtom, newNode);
277
279
  this.onNodeChanged.emit({
278
280
  id,
279
281
  node: newNode
@@ -293,13 +295,13 @@ var Graph = class {
293
295
  }
294
296
  }
295
297
  removeNodes(ids, edges = false) {
296
- Rx.batch(() => {
298
+ Atom.batch(() => {
297
299
  ids.map((id) => this.removeNode(id, edges));
298
300
  });
299
301
  }
300
302
  removeNode(id, edges = false) {
301
- const nodeRx = this._node(id);
302
- this._registry.set(nodeRx, Option.none());
303
+ const nodeAtom = this._node(id);
304
+ this._registry.set(nodeAtom, Option.none());
303
305
  this.onNodeChanged.emit({
304
306
  id,
305
307
  node: Option.none()
@@ -321,24 +323,24 @@ var Graph = class {
321
323
  this._onRemoveNode?.(id);
322
324
  }
323
325
  addEdges(edges) {
324
- Rx.batch(() => {
326
+ Atom.batch(() => {
325
327
  edges.map((edge) => this.addEdge(edge));
326
328
  });
327
329
  }
328
330
  addEdge(edgeArg) {
329
- const sourceRx = this._edges(edgeArg.source);
330
- const source = this._registry.get(sourceRx);
331
+ const sourceAtom = this._edges(edgeArg.source);
332
+ const source = this._registry.get(sourceAtom);
331
333
  if (!source.outbound.includes(edgeArg.target)) {
332
334
  log("add outbound edge", {
333
335
  source: edgeArg.source,
334
336
  target: edgeArg.target
335
337
  }, {
336
338
  F: __dxlog_file,
337
- L: 480,
339
+ L: 505,
338
340
  S: this,
339
341
  C: (f, a) => f(...a)
340
342
  });
341
- this._registry.set(sourceRx, {
343
+ this._registry.set(sourceAtom, {
342
344
  inbound: source.inbound,
343
345
  outbound: [
344
346
  ...source.outbound,
@@ -346,19 +348,19 @@ var Graph = class {
346
348
  ]
347
349
  });
348
350
  }
349
- const targetRx = this._edges(edgeArg.target);
350
- const target = this._registry.get(targetRx);
351
+ const targetAtom = this._edges(edgeArg.target);
352
+ const target = this._registry.get(targetAtom);
351
353
  if (!target.inbound.includes(edgeArg.source)) {
352
354
  log("add inbound edge", {
353
355
  source: edgeArg.source,
354
356
  target: edgeArg.target
355
357
  }, {
356
358
  F: __dxlog_file,
357
- L: 487,
359
+ L: 518,
358
360
  S: this,
359
361
  C: (f, a) => f(...a)
360
362
  });
361
- this._registry.set(targetRx, {
363
+ this._registry.set(targetAtom, {
362
364
  inbound: [
363
365
  ...target.inbound,
364
366
  edgeArg.source
@@ -368,30 +370,30 @@ var Graph = class {
368
370
  }
369
371
  }
370
372
  removeEdges(edges, removeOrphans = false) {
371
- Rx.batch(() => {
373
+ Atom.batch(() => {
372
374
  edges.map((edge) => this.removeEdge(edge, removeOrphans));
373
375
  });
374
376
  }
375
377
  removeEdge(edgeArg, removeOrphans = false) {
376
- const sourceRx = this._edges(edgeArg.source);
377
- const source = this._registry.get(sourceRx);
378
+ const sourceAtom = this._edges(edgeArg.source);
379
+ const source = this._registry.get(sourceAtom);
378
380
  if (source.outbound.includes(edgeArg.target)) {
379
- this._registry.set(sourceRx, {
381
+ this._registry.set(sourceAtom, {
380
382
  inbound: source.inbound,
381
383
  outbound: source.outbound.filter((id) => id !== edgeArg.target)
382
384
  });
383
385
  }
384
- const targetRx = this._edges(edgeArg.target);
385
- const target = this._registry.get(targetRx);
386
+ const targetAtom = this._edges(edgeArg.target);
387
+ const target = this._registry.get(targetAtom);
386
388
  if (target.inbound.includes(edgeArg.source)) {
387
- this._registry.set(targetRx, {
389
+ this._registry.set(targetAtom, {
388
390
  inbound: target.inbound.filter((id) => id !== edgeArg.source),
389
391
  outbound: target.outbound
390
392
  });
391
393
  }
392
394
  if (removeOrphans) {
393
- const source2 = this._registry.get(sourceRx);
394
- const target2 = this._registry.get(targetRx);
395
+ const source2 = this._registry.get(sourceAtom);
396
+ const target2 = this._registry.get(targetAtom);
395
397
  if (source2.outbound.length === 0 && source2.inbound.length === 0 && edgeArg.source !== ROOT_ID) {
396
398
  this.removeNodes([
397
399
  edgeArg.source
@@ -405,15 +407,15 @@ var Graph = class {
405
407
  }
406
408
  }
407
409
  sortEdges(id, relation, order) {
408
- const edgesRx = this._edges(id);
409
- const edges = this._registry.get(edgesRx);
410
+ const edgesAtom = this._edges(id);
411
+ const edges = this._registry.get(edgesAtom);
410
412
  const unsorted = edges[relation].filter((id2) => !order.includes(id2)) ?? [];
411
413
  const sorted = order.filter((id2) => edges[relation].includes(id2)) ?? [];
412
414
  edges[relation].splice(0, edges[relation].length, ...[
413
415
  ...sorted,
414
416
  ...unsorted
415
417
  ]);
416
- this._registry.set(edgesRx, edges);
418
+ this._registry.set(edgesAtom, edges);
417
419
  }
418
420
  traverse({ visitor, source = ROOT_ID, relation = "outbound" }, path = []) {
419
421
  if (path.includes(source)) {
@@ -437,7 +439,7 @@ var Graph = class {
437
439
  ]));
438
440
  }
439
441
  getPath({ source = "root", target }) {
440
- return pipe(this.getNode(source), Option.flatMap((node) => {
442
+ return Function.pipe(this.getNode(source), Option.flatMap((node) => {
441
443
  let found = Option.none();
442
444
  this.traverse({
443
445
  source: node.id,
@@ -481,9 +483,12 @@ var Graph = class {
481
483
  };
482
484
 
483
485
  // src/graph-builder.ts
484
- import { Registry as Registry2, Rx as Rx2 } from "@effect-rx/rx-react";
486
+ import { Atom as Atom2, Registry as Registry2 } from "@effect-atom/atom-react";
485
487
  import { effect } from "@preact/signals-core";
486
- import { Array, Option as Option2, Record as Record2, pipe as pipe2 } from "effect";
488
+ import * as Array from "effect/Array";
489
+ import * as Function2 from "effect/Function";
490
+ import * as Option2 from "effect/Option";
491
+ import * as Record2 from "effect/Record";
487
492
  import { log as log2 } from "@dxos/log";
488
493
  import { byPosition, getDebugName, isNode, isNonNullable as isNonNullable2 } from "@dxos/util";
489
494
 
@@ -499,10 +504,10 @@ var __dxlog_file2 = "/__w/dxos/dxos/packages/sdk/app-graph/src/graph-builder.ts"
499
504
  var createExtension = (extension) => {
500
505
  const { id, position = "static", relation = "outbound", resolver: _resolver, connector: _connector, actions: _actions, actionGroups: _actionGroups } = extension;
501
506
  const getId = (key) => `${id}/${key}`;
502
- const resolver = _resolver && Rx2.family((id2) => _resolver(id2).pipe(Rx2.withLabel(`graph-builder:_resolver:${id2}`)));
503
- const connector = _connector && Rx2.family((node) => _connector(node).pipe(Rx2.withLabel(`graph-builder:_connector:${id}`)));
504
- const actionGroups = _actionGroups && Rx2.family((node) => _actionGroups(node).pipe(Rx2.withLabel(`graph-builder:_actionGroups:${id}`)));
505
- const actions = _actions && Rx2.family((node) => _actions(node).pipe(Rx2.withLabel(`graph-builder:_actions:${id}`)));
507
+ const resolver = _resolver && Atom2.family((id2) => _resolver(id2).pipe(Atom2.withLabel(`graph-builder:_resolver:${id2}`)));
508
+ const connector = _connector && Atom2.family((node) => _connector(node).pipe(Atom2.withLabel(`graph-builder:_connector:${id}`)));
509
+ const actionGroups = _actionGroups && Atom2.family((node) => _actionGroups(node).pipe(Atom2.withLabel(`graph-builder:_actionGroups:${id}`)));
510
+ const actions = _actions && Atom2.family((node) => _actions(node).pipe(Atom2.withLabel(`graph-builder:_actions:${id}`)));
506
511
  return [
507
512
  resolver ? {
508
513
  id: getId("resolver"),
@@ -513,30 +518,30 @@ var createExtension = (extension) => {
513
518
  id: getId("connector"),
514
519
  position,
515
520
  relation,
516
- connector: Rx2.family((node) => Rx2.make((get) => {
521
+ connector: Atom2.family((node) => Atom2.make((get2) => {
517
522
  try {
518
- return get(connector(node));
523
+ return get2(connector(node));
519
524
  } catch {
520
525
  log2.warn("Error in connector", {
521
526
  id: getId("connector"),
522
527
  node
523
528
  }, {
524
529
  F: __dxlog_file2,
525
- L: 109,
530
+ L: 114,
526
531
  S: void 0,
527
532
  C: (f, a) => f(...a)
528
533
  });
529
534
  return [];
530
535
  }
531
- }).pipe(Rx2.withLabel(`graph-builder:connector:${id}`)))
536
+ }).pipe(Atom2.withLabel(`graph-builder:connector:${id}`)))
532
537
  } : void 0,
533
538
  actionGroups ? {
534
539
  id: getId("actionGroups"),
535
540
  position,
536
541
  relation: "outbound",
537
- connector: Rx2.family((node) => Rx2.make((get) => {
542
+ connector: Atom2.family((node) => Atom2.make((get2) => {
538
543
  try {
539
- return get(actionGroups(node)).map((arg) => ({
544
+ return get2(actionGroups(node)).map((arg) => ({
540
545
  ...arg,
541
546
  data: actionGroupSymbol,
542
547
  type: ACTION_GROUP_TYPE
@@ -547,21 +552,21 @@ var createExtension = (extension) => {
547
552
  node
548
553
  }, {
549
554
  F: __dxlog_file2,
550
- L: 130,
555
+ L: 135,
551
556
  S: void 0,
552
557
  C: (f, a) => f(...a)
553
558
  });
554
559
  return [];
555
560
  }
556
- }).pipe(Rx2.withLabel(`graph-builder:connector:actionGroups:${id}`)))
561
+ }).pipe(Atom2.withLabel(`graph-builder:connector:actionGroups:${id}`)))
557
562
  } : void 0,
558
563
  actions ? {
559
564
  id: getId("actions"),
560
565
  position,
561
566
  relation: "outbound",
562
- connector: Rx2.family((node) => Rx2.make((get) => {
567
+ connector: Atom2.family((node) => Atom2.make((get2) => {
563
568
  try {
564
- return get(actions(node)).map((arg) => ({
569
+ return get2(actions(node)).map((arg) => ({
565
570
  ...arg,
566
571
  type: ACTION_TYPE
567
572
  }));
@@ -571,13 +576,13 @@ var createExtension = (extension) => {
571
576
  node
572
577
  }, {
573
578
  F: __dxlog_file2,
574
- L: 147,
579
+ L: 152,
575
580
  S: void 0,
576
581
  C: (f, a) => f(...a)
577
582
  });
578
583
  return [];
579
584
  }
580
- }).pipe(Rx2.withLabel(`graph-builder:connector:actions:${id}`)))
585
+ }).pipe(Atom2.withLabel(`graph-builder:connector:actions:${id}`)))
581
586
  } : void 0
582
587
  ].filter(isNonNullable2);
583
588
  };
@@ -597,7 +602,7 @@ var flattenExtensions = (extension, acc = []) => {
597
602
  var GraphBuilder = class _GraphBuilder {
598
603
  // TODO(wittjosiah): Use Context.
599
604
  _subscriptions = /* @__PURE__ */ new Map();
600
- _extensions = Rx2.make(Record2.empty()).pipe(Rx2.keepAlive, Rx2.withLabel("graph-builder:extensions"));
605
+ _extensions = Atom2.make(Record2.empty()).pipe(Atom2.keepAlive, Atom2.withLabel("graph-builder:extensions"));
601
606
  _initialized = {};
602
607
  _registry;
603
608
  _graph;
@@ -680,26 +685,26 @@ var GraphBuilder = class _GraphBuilder {
680
685
  this._subscriptions.forEach((unsubscribe) => unsubscribe());
681
686
  this._subscriptions.clear();
682
687
  }
683
- _resolvers = Rx2.family((id) => {
684
- return Rx2.make((get) => {
685
- return pipe2(get(this._extensions), Record2.values, Array.sortBy(byPosition), Array.map(({ resolver }) => resolver), Array.filter(isNonNullable2), Array.map((resolver) => get(resolver(id))), Array.filter(isNonNullable2), Array.head);
688
+ _resolvers = Atom2.family((id) => {
689
+ return Atom2.make((get2) => {
690
+ return Function2.pipe(get2(this._extensions), Record2.values, Array.sortBy(byPosition), Array.map(({ resolver }) => resolver), Array.filter(isNonNullable2), Array.map((resolver) => get2(resolver(id))), Array.filter(isNonNullable2), Array.head);
686
691
  });
687
692
  });
688
- _connectors = Rx2.family((key) => {
689
- return Rx2.make((get) => {
693
+ _connectors = Atom2.family((key) => {
694
+ return Atom2.make((get2) => {
690
695
  const [id, relation] = key.split("+");
691
696
  const node = this._graph.node(id);
692
- return pipe2(
693
- get(this._extensions),
697
+ return Function2.pipe(
698
+ get2(this._extensions),
694
699
  Record2.values,
695
700
  // TODO(wittjosiah): Sort on write rather than read.
696
701
  Array.sortBy(byPosition),
697
702
  Array.filter(({ relation: _relation = "outbound" }) => _relation === relation),
698
703
  Array.map(({ connector }) => connector?.(node)),
699
704
  Array.filter(isNonNullable2),
700
- Array.flatMap((result) => get(result))
705
+ Array.flatMap((result) => get2(result))
701
706
  );
702
- }).pipe(Rx2.withLabel(`graph-builder:connectors:${key}`));
707
+ }).pipe(Atom2.withLabel(`graph-builder:connectors:${key}`));
703
708
  });
704
709
  _onExpand(id, relation) {
705
710
  log2("onExpand", {
@@ -708,7 +713,7 @@ var GraphBuilder = class _GraphBuilder {
708
713
  registry: getDebugName(this._registry)
709
714
  }, {
710
715
  F: __dxlog_file2,
711
- L: 324,
716
+ L: 329,
712
717
  S: this,
713
718
  C: (f, a) => f(...a)
714
719
  });
@@ -725,12 +730,12 @@ var GraphBuilder = class _GraphBuilder {
725
730
  removed
726
731
  }, {
727
732
  F: __dxlog_file2,
728
- L: 335,
733
+ L: 340,
729
734
  S: this,
730
735
  C: (f, a) => f(...a)
731
736
  });
732
737
  const update = () => {
733
- Rx2.batch(() => {
738
+ Atom2.batch(() => {
734
739
  this._graph.removeEdges(removed.map((target) => ({
735
740
  source: id,
736
741
  target
@@ -762,7 +767,7 @@ var GraphBuilder = class _GraphBuilder {
762
767
  id
763
768
  }, {
764
769
  F: __dxlog_file2,
765
- L: 372,
770
+ L: 377,
766
771
  S: this,
767
772
  C: (f, a) => f(...a)
768
773
  });
@@ -793,23 +798,23 @@ var GraphBuilder = class _GraphBuilder {
793
798
  this._subscriptions.delete(id);
794
799
  }
795
800
  };
796
- var rxFromSignal = (cb) => {
797
- return Rx2.make((get) => {
801
+ var atomFromSignal = (cb) => {
802
+ return Atom2.make((get2) => {
798
803
  const dispose = effect(() => {
799
- get.setSelf(cb());
804
+ get2.setSelf(cb());
800
805
  });
801
- get.addFinalizer(() => dispose());
806
+ get2.addFinalizer(() => dispose());
802
807
  return cb();
803
808
  });
804
809
  };
805
- var observableFamily = Rx2.family((observable) => {
806
- return Rx2.make((get) => {
807
- const subscription = observable.subscribe((value) => get.setSelf(value));
808
- get.addFinalizer(() => subscription.unsubscribe());
810
+ var observableFamily = Atom2.family((observable) => {
811
+ return Atom2.make((get2) => {
812
+ const subscription = observable.subscribe((value) => get2.setSelf(value));
813
+ get2.addFinalizer(() => subscription.unsubscribe());
809
814
  return observable.get();
810
815
  });
811
816
  });
812
- var rxFromObservable = (observable) => {
817
+ var atomFromObservable = (observable) => {
813
818
  return observableFamily(observable);
814
819
  };
815
820
  export {
@@ -820,14 +825,14 @@ export {
820
825
  ROOT_ID,
821
826
  ROOT_TYPE,
822
827
  actionGroupSymbol,
828
+ atomFromObservable,
829
+ atomFromSignal,
823
830
  createExtension,
824
831
  flattenExtensions,
825
832
  getGraph,
826
833
  isAction,
827
834
  isActionGroup,
828
835
  isActionLike,
829
- isGraphNode,
830
- rxFromObservable,
831
- rxFromSignal
836
+ isGraphNode
832
837
  };
833
838
  //# sourceMappingURL=index.mjs.map