@ai-matrx/records 0.58.21 → 0.58.23

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,8 +2,13 @@
2
2
  "use client";
3
3
  var __defProp = Object.defineProperty;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __esm = (fn, res) => function __init() {
6
- return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
5
+ var __esm = (fn, res, err2) => function __init() {
6
+ if (err2) throw err2[0];
7
+ try {
8
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
9
+ } catch (e) {
10
+ throw err2 = [e], e;
11
+ }
7
12
  };
8
13
  var __export = (target, all) => {
9
14
  for (var name in all)
@@ -7887,13 +7892,17 @@ function useAsync(run, deps, share) {
7887
7892
  return { ...state, reload, setData };
7888
7893
  }
7889
7894
  function useTable(tableId) {
7895
+ const revision = useShapeRevision(tableId);
7896
+ useEffect(() => {
7897
+ if (tableId) registerShapeInterest(tableId);
7898
+ }, [tableId]);
7890
7899
  return useAsync(
7891
7900
  async (client) => {
7892
7901
  if (!tableId) return { ok: true, data: null };
7893
7902
  return client.tableRead({ table_id: tableId });
7894
7903
  },
7895
- [tableId],
7896
- tableId ? `table:${tableId}` : null
7904
+ [tableId, revision],
7905
+ tableId ? `table:${tableId}:${revision}` : null
7897
7906
  );
7898
7907
  }
7899
7908
  function useTables() {