@xuda.io/runtime-bundle 1.0.1282 → 1.0.1283

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.
@@ -8985,50 +8985,6 @@ func.UI.update_xu_ref = function (SESSION_ID, dsSessionP, ref_field_id, $elm) {
8985
8985
 
8986
8986
  const _ds = func.utils.clean_returned_datasource(SESSION_ID, dsSessionP);
8987
8987
 
8988
- //////////////
8989
- // function createWatchedObject(obj, onChange) {
8990
- // return new Proxy(obj, {
8991
- // set(target, property, value) {
8992
- // const oldValue = target[property];
8993
- // target[property] = value;
8994
-
8995
- // if (oldValue !== value) {
8996
- // onChange({
8997
- // property,
8998
- // oldValue,
8999
- // newValue: value,
9000
- // timestamp: new Date(),
9001
- // });
9002
- // }
9003
-
9004
- // return true;
9005
- // },
9006
-
9007
- // deleteProperty(target, property) {
9008
- // const oldValue = target[property];
9009
- // delete target[property];
9010
-
9011
- // onChange({
9012
- // property,
9013
- // oldValue,
9014
- // newValue: undefined,
9015
- // deleted: true,
9016
- // timestamp: new Date(),
9017
- // });
9018
-
9019
- // return true;
9020
- // },
9021
- // });
9022
- // }
9023
-
9024
- // // Usage
9025
- // const watchedUser = createWatchedObject(
9026
- // { name: "John", age: 25 },
9027
- // (change) => console.log("Change detected:", change)
9028
- // );
9029
-
9030
- // watchedUser.age = 26; // Logs: Change detected: { property: "age", oldValue: 25, newValue: 26, ... }
9031
-
9032
8988
  function createWatchedObject(obj, onChange) {
9033
8989
  const watchers = new WeakMap();
9034
8990
 
@@ -9100,7 +9056,16 @@ func.UI.update_xu_ref = function (SESSION_ID, dsSessionP, ref_field_id, $elm) {
9100
9056
  console.log('Change detected:', change);
9101
9057
  const { path, newValue } = change;
9102
9058
  try {
9103
- _session.DS_GLB[dsSessionP].watcher = { path, newValue };
9059
+ // _session.DS_GLB[dsSessionP].watcher = { path, newValue };
9060
+
9061
+ const datasource_changes = {
9062
+ [dsSessionP]: {
9063
+ ['datasource_main']: {
9064
+ watcher: { path, newValue },
9065
+ },
9066
+ },
9067
+ };
9068
+ await func.datasource.update(SESSION_ID, datasource_changes);
9104
9069
 
9105
9070
  // _.set(_session.DS_GLB[dsSessionP].watcher, change.path, change.newValue);
9106
9071
 
@@ -8986,50 +8986,6 @@ func.UI.update_xu_ref = function (SESSION_ID, dsSessionP, ref_field_id, $elm) {
8986
8986
 
8987
8987
  const _ds = func.utils.clean_returned_datasource(SESSION_ID, dsSessionP);
8988
8988
 
8989
- //////////////
8990
- // function createWatchedObject(obj, onChange) {
8991
- // return new Proxy(obj, {
8992
- // set(target, property, value) {
8993
- // const oldValue = target[property];
8994
- // target[property] = value;
8995
-
8996
- // if (oldValue !== value) {
8997
- // onChange({
8998
- // property,
8999
- // oldValue,
9000
- // newValue: value,
9001
- // timestamp: new Date(),
9002
- // });
9003
- // }
9004
-
9005
- // return true;
9006
- // },
9007
-
9008
- // deleteProperty(target, property) {
9009
- // const oldValue = target[property];
9010
- // delete target[property];
9011
-
9012
- // onChange({
9013
- // property,
9014
- // oldValue,
9015
- // newValue: undefined,
9016
- // deleted: true,
9017
- // timestamp: new Date(),
9018
- // });
9019
-
9020
- // return true;
9021
- // },
9022
- // });
9023
- // }
9024
-
9025
- // // Usage
9026
- // const watchedUser = createWatchedObject(
9027
- // { name: "John", age: 25 },
9028
- // (change) => console.log("Change detected:", change)
9029
- // );
9030
-
9031
- // watchedUser.age = 26; // Logs: Change detected: { property: "age", oldValue: 25, newValue: 26, ... }
9032
-
9033
8989
  function createWatchedObject(obj, onChange) {
9034
8990
  const watchers = new WeakMap();
9035
8991
 
@@ -9101,7 +9057,16 @@ func.UI.update_xu_ref = function (SESSION_ID, dsSessionP, ref_field_id, $elm) {
9101
9057
  console.log('Change detected:', change);
9102
9058
  const { path, newValue } = change;
9103
9059
  try {
9104
- _session.DS_GLB[dsSessionP].watcher = { path, newValue };
9060
+ // _session.DS_GLB[dsSessionP].watcher = { path, newValue };
9061
+
9062
+ const datasource_changes = {
9063
+ [dsSessionP]: {
9064
+ ['datasource_main']: {
9065
+ watcher: { path, newValue },
9066
+ },
9067
+ },
9068
+ };
9069
+ await func.datasource.update(SESSION_ID, datasource_changes);
9105
9070
 
9106
9071
  // _.set(_session.DS_GLB[dsSessionP].watcher, change.path, change.newValue);
9107
9072