@pylonsync/react 0.3.9 → 0.3.11

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.
Files changed (2) hide show
  1. package/package.json +3 -3
  2. package/src/hooks.ts +4 -4
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.3.9",
6
+ "version": "0.3.11",
7
7
  "type": "module",
8
8
  "main": "src/index.ts",
9
9
  "types": "src/index.ts",
@@ -12,8 +12,8 @@
12
12
  "check": "tsc -p tsconfig.json --noEmit"
13
13
  },
14
14
  "dependencies": {
15
- "@pylonsync/sdk": "0.3.9",
16
- "@pylonsync/sync": "0.3.9"
15
+ "@pylonsync/sdk": "0.3.10",
16
+ "@pylonsync/sync": "0.3.10"
17
17
  },
18
18
  "peerDependencies": {
19
19
  "react": ">=18.0.0"
package/src/hooks.ts CHANGED
@@ -872,9 +872,9 @@ export function useSearch<T = Row>(
872
872
  });
873
873
  const json = (await res.json()) as {
874
874
  hits?: T[];
875
- facet_counts?: Record<string, Record<string, number>>;
875
+ facetCounts?: Record<string, Record<string, number>>;
876
876
  total?: number;
877
- took_ms?: number;
877
+ tookMs?: number;
878
878
  error?: { message: string };
879
879
  };
880
880
  if (myId !== requestIdRef.current) return; // stale — newer in flight
@@ -882,9 +882,9 @@ export function useSearch<T = Row>(
882
882
  throw new Error(json.error?.message ?? `HTTP ${res.status}`);
883
883
  }
884
884
  setHits(json.hits ?? []);
885
- setFacetCounts(json.facet_counts ?? {});
885
+ setFacetCounts(json.facetCounts ?? {});
886
886
  setTotal(json.total ?? 0);
887
- setTookMs(json.took_ms ?? 0);
887
+ setTookMs(json.tookMs ?? 0);
888
888
  } catch (e) {
889
889
  if (myId !== requestIdRef.current) return; // stale — ignore
890
890
  if ((e as Error)?.name === "AbortError") return;