@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.
@@ -7,8 +7,13 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
7
7
  var __getOwnPropNames = Object.getOwnPropertyNames;
8
8
  var __getProtoOf = Object.getPrototypeOf;
9
9
  var __hasOwnProp = Object.prototype.hasOwnProperty;
10
- var __esm = (fn, res) => function __init() {
11
- return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
10
+ var __esm = (fn, res, err2) => function __init() {
11
+ if (err2) throw err2[0];
12
+ try {
13
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
14
+ } catch (e) {
15
+ throw err2 = [e], e;
16
+ }
12
17
  };
13
18
  var __export = (target, all) => {
14
19
  for (var name in all)
@@ -8051,13 +8056,17 @@ function useAsync(run, deps, share) {
8051
8056
  return { ...state, reload, setData };
8052
8057
  }
8053
8058
  function useTable(tableId) {
8059
+ const revision = useShapeRevision(tableId);
8060
+ (0, import_react2.useEffect)(() => {
8061
+ if (tableId) registerShapeInterest(tableId);
8062
+ }, [tableId]);
8054
8063
  return useAsync(
8055
8064
  async (client) => {
8056
8065
  if (!tableId) return { ok: true, data: null };
8057
8066
  return client.tableRead({ table_id: tableId });
8058
8067
  },
8059
- [tableId],
8060
- tableId ? `table:${tableId}` : null
8068
+ [tableId, revision],
8069
+ tableId ? `table:${tableId}:${revision}` : null
8061
8070
  );
8062
8071
  }
8063
8072
  function useTables() {