@xuda.io/runtime-bundle 1.0.1359 → 1.0.1361
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.
- package/js/modules/xuda-cli-plugin-html-parser-module.esm.min.mjs +1 -0
- package/js/modules/xuda-cli-plugin-html-parser-module.esm.mjs +703 -0
- package/js/xuda-runtime-bundle.js +16 -7
- package/js/xuda-runtime-bundle.min.js +2 -2
- package/js/xuda-runtime-slim.js +16 -7
- package/js/xuda-runtime-slim.min.es.js +16 -7
- package/js/xuda-runtime-slim.min.js +2 -2
- package/js/xuda-server-bundle.min.mjs +1 -1
- package/js/xuda-server-bundle.mjs +6 -1
- package/js/xuda-worker-bundle.js +6 -1
- package/js/xuda-worker-bundle.min.js +1 -1
- package/js/xuda_common-bundle.js +6 -1
- package/js/xuda_common-bundle.min.js +1 -1
- package/package.json +1 -1
package/js/xuda-runtime-slim.js
CHANGED
|
@@ -2509,10 +2509,15 @@ func.api.watch = function (path, cb, opt = {}) {
|
|
|
2509
2509
|
_session.watchers = {};
|
|
2510
2510
|
}
|
|
2511
2511
|
|
|
2512
|
-
_session.watchers[path] = cb;
|
|
2512
|
+
_session.watchers[path] = { ...opt, handler: cb };
|
|
2513
|
+
|
|
2513
2514
|
if (opt.immediate) {
|
|
2514
2515
|
const value = _.get(SESSION_OBJ[SESSION_ID].DS_GLB[0], path);
|
|
2515
2516
|
cb({ path, newValue: value, oldValue: value, timestamp: Date.now(), opt });
|
|
2517
|
+
|
|
2518
|
+
if (opt.once) {
|
|
2519
|
+
delete _session.watchers[path];
|
|
2520
|
+
}
|
|
2516
2521
|
}
|
|
2517
2522
|
return 'ok';
|
|
2518
2523
|
};
|
|
@@ -20270,15 +20275,19 @@ func.index.set_ds_0_proxy = function (SESSION_ID) {
|
|
|
20270
20275
|
|
|
20271
20276
|
let watch_path = 'data_system.' + path;
|
|
20272
20277
|
|
|
20278
|
+
const runHandler = () => {
|
|
20279
|
+
const { handler, once } = _session?.watchers?.[watch_path];
|
|
20280
|
+
handler(change);
|
|
20281
|
+
if (once) {
|
|
20282
|
+
delete _session.watchers[watch_path];
|
|
20283
|
+
}
|
|
20284
|
+
};
|
|
20285
|
+
|
|
20273
20286
|
if (_session?.watchers?.[watch_path]) {
|
|
20274
|
-
|
|
20275
|
-
fx(change);
|
|
20287
|
+
runHandler();
|
|
20276
20288
|
} else {
|
|
20277
20289
|
watch_path = 'data_system.SYS_GLOBAL_OBJ_REFS.' + path;
|
|
20278
|
-
|
|
20279
|
-
const fx = _session?.watchers?.[watch_path];
|
|
20280
|
-
fx(change);
|
|
20281
|
-
}
|
|
20290
|
+
runHandler();
|
|
20282
20291
|
}
|
|
20283
20292
|
if (_.isEqual(newValue, oldValue)) return;
|
|
20284
20293
|
////////////////////////
|
|
@@ -2510,10 +2510,15 @@ func.api.watch = function (path, cb, opt = {}) {
|
|
|
2510
2510
|
_session.watchers = {};
|
|
2511
2511
|
}
|
|
2512
2512
|
|
|
2513
|
-
_session.watchers[path] = cb;
|
|
2513
|
+
_session.watchers[path] = { ...opt, handler: cb };
|
|
2514
|
+
|
|
2514
2515
|
if (opt.immediate) {
|
|
2515
2516
|
const value = _.get(SESSION_OBJ[SESSION_ID].DS_GLB[0], path);
|
|
2516
2517
|
cb({ path, newValue: value, oldValue: value, timestamp: Date.now(), opt });
|
|
2518
|
+
|
|
2519
|
+
if (opt.once) {
|
|
2520
|
+
delete _session.watchers[path];
|
|
2521
|
+
}
|
|
2517
2522
|
}
|
|
2518
2523
|
return 'ok';
|
|
2519
2524
|
};
|
|
@@ -20271,15 +20276,19 @@ func.index.set_ds_0_proxy = function (SESSION_ID) {
|
|
|
20271
20276
|
|
|
20272
20277
|
let watch_path = 'data_system.' + path;
|
|
20273
20278
|
|
|
20279
|
+
const runHandler = () => {
|
|
20280
|
+
const { handler, once } = _session?.watchers?.[watch_path];
|
|
20281
|
+
handler(change);
|
|
20282
|
+
if (once) {
|
|
20283
|
+
delete _session.watchers[watch_path];
|
|
20284
|
+
}
|
|
20285
|
+
};
|
|
20286
|
+
|
|
20274
20287
|
if (_session?.watchers?.[watch_path]) {
|
|
20275
|
-
|
|
20276
|
-
fx(change);
|
|
20288
|
+
runHandler();
|
|
20277
20289
|
} else {
|
|
20278
20290
|
watch_path = 'data_system.SYS_GLOBAL_OBJ_REFS.' + path;
|
|
20279
|
-
|
|
20280
|
-
const fx = _session?.watchers?.[watch_path];
|
|
20281
|
-
fx(change);
|
|
20282
|
-
}
|
|
20291
|
+
runHandler();
|
|
20283
20292
|
}
|
|
20284
20293
|
if (_.isEqual(newValue, oldValue)) return;
|
|
20285
20294
|
////////////////////////
|