@spooky-sync/client-solid2 0.0.1-canary.323 → 0.0.1-canary.325

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.
@@ -2,11 +2,14 @@ import { createEffect, createSignal, type Accessor } from 'solid-js';
2
2
  import { useDb } from './context';
3
3
  import type { CrdtField } from '@spooky-sync/core';
4
4
 
5
+ /**
6
+ * Open a `@crdt` field of the record `recordId()` names, for an editor to bind
7
+ * to (`field()?.getDoc()`). Re-opens when the id changes; closes on cleanup.
8
+ */
5
9
  export function useCrdtField(
6
10
  table: string,
7
11
  recordId: () => string | undefined,
8
- field: string,
9
- fallbackText?: () => string | undefined
12
+ field: string
10
13
  ): Accessor<CrdtField | null> {
11
14
  const db = useDb();
12
15
  const [crdtField, setCrdtField] = createSignal<CrdtField | null>(null, { ownedWrite: true });
@@ -24,9 +27,8 @@ export function useCrdtField(
24
27
  }
25
28
  const sp00ky = db.getSp00ky();
26
29
  let superseded = false;
27
- const text = fallbackText?.();
28
30
  sp00ky
29
- .openCrdtField(table, id, field, text)
31
+ .openCrdtField(table, id, field)
30
32
  .then((cf) => {
31
33
  if (!superseded) {
32
34
  setCrdtField(cf);