@seedprotocol/react 0.7.8-next.1071.g2a141c1 → 0.7.8-next.1101.g18b928b

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.
@@ -0,0 +1,22 @@
1
+ import { ChangeWatch } from '@seedprotocol/sdk';
2
+ type RowsQuery = {
3
+ all: () => Promise<unknown[]>;
4
+ toSQL: () => {
5
+ sql: string;
6
+ params: unknown[];
7
+ };
8
+ };
9
+ /**
10
+ * Rows of a Drizzle query on one seed's rows, re-read when the SDK's change feed reports a write
11
+ * to them (ADR 0020), instead of a liveQuery that re-runs on every write to the tables it reads.
12
+ * `watch` names the seed and tables the query reads; it must cover every row the query returns.
13
+ * Same `{ data, error }` as useLiveQueryState: `data` is undefined until the first read and resets
14
+ * when the query or watch changes. A failed read reports `error` and keeps the last rows; the next
15
+ * change reads again. Where the feed doesn't run (Node), falls back to useLiveQueryState.
16
+ */
17
+ export declare function useEntityRowsState<T>(watch: ChangeWatch | null | undefined, query: RowsQuery | null | undefined): {
18
+ data: T[] | undefined;
19
+ error: Error | null;
20
+ };
21
+ export {};
22
+ //# sourceMappingURL=entityRows.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entityRows.d.ts","sourceRoot":"","sources":["../src/entityRows.ts"],"names":[],"mappings":"AACA,OAAO,EAAwC,KAAK,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAI1F,KAAK,SAAS,GAAG;IAAE,GAAG,EAAE,MAAM,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;IAAC,KAAK,EAAE,MAAM;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,OAAO,EAAE,CAAA;KAAE,CAAA;CAAE,CAAA;AAEnG;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAClC,KAAK,EAAE,WAAW,GAAG,IAAI,GAAG,SAAS,EACrC,KAAK,EAAE,SAAS,GAAG,IAAI,GAAG,SAAS,GAClC;IAAE,IAAI,EAAE,CAAC,EAAE,GAAG,SAAS,CAAC;IAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAA;CAAE,CA8BhD"}