mol_plot_all 1.2.1321 → 1.2.1323
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/node.deps.json +1 -1
- package/node.js +26 -2
- package/node.js.map +1 -1
- package/node.mjs +26 -2
- package/node.test.js +26 -2
- package/node.test.js.map +1 -1
- package/package.json +1 -1
- package/web.test.js +26 -2
- package/web.test.js.map +1 -1
package/package.json
CHANGED
package/web.test.js
CHANGED
|
@@ -1268,18 +1268,42 @@ var $;
|
|
|
1268
1268
|
factories.set(val, make);
|
|
1269
1269
|
return make;
|
|
1270
1270
|
}
|
|
1271
|
+
const getters = new WeakMap();
|
|
1272
|
+
function get_prop(host, field) {
|
|
1273
|
+
let props = getters.get(host);
|
|
1274
|
+
let get_val = props?.[field];
|
|
1275
|
+
if (get_val)
|
|
1276
|
+
return get_val;
|
|
1277
|
+
get_val = (next) => {
|
|
1278
|
+
if (next !== undefined)
|
|
1279
|
+
host[field] = next;
|
|
1280
|
+
return host[field];
|
|
1281
|
+
};
|
|
1282
|
+
Object.defineProperty(get_val, 'name', { value: field });
|
|
1283
|
+
if (!props) {
|
|
1284
|
+
props = {};
|
|
1285
|
+
getters.set(host, props);
|
|
1286
|
+
}
|
|
1287
|
+
props[field] = get_val;
|
|
1288
|
+
return get_val;
|
|
1289
|
+
}
|
|
1271
1290
|
function $mol_wire_sync(obj) {
|
|
1272
1291
|
return new Proxy(obj, {
|
|
1273
1292
|
get(obj, field) {
|
|
1274
1293
|
let val = obj[field];
|
|
1294
|
+
const temp = $mol_wire_task.getter(typeof val === 'function' ? val : get_prop(obj, field));
|
|
1275
1295
|
if (typeof val !== 'function')
|
|
1276
|
-
return
|
|
1277
|
-
const temp = $mol_wire_task.getter(val);
|
|
1296
|
+
return temp(obj, []).sync();
|
|
1278
1297
|
return function $mol_wire_sync(...args) {
|
|
1279
1298
|
const fiber = temp(obj, args);
|
|
1280
1299
|
return fiber.sync();
|
|
1281
1300
|
};
|
|
1282
1301
|
},
|
|
1302
|
+
set(obj, field, next) {
|
|
1303
|
+
const temp = $mol_wire_task.getter(get_prop(obj, field));
|
|
1304
|
+
temp(obj, [next]).sync();
|
|
1305
|
+
return true;
|
|
1306
|
+
},
|
|
1283
1307
|
construct(obj, args) {
|
|
1284
1308
|
const temp = $mol_wire_task.getter(factory(obj));
|
|
1285
1309
|
return temp(obj, args).sync();
|