mol_dump_lib 0.0.640 → 0.0.642
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.deps.json +1 -1
- package/web.js +26 -2
- package/web.js.map +1 -1
- package/web.mjs +26 -2
package/web.mjs
CHANGED
|
@@ -4597,18 +4597,42 @@ var $;
|
|
|
4597
4597
|
factories.set(val, make);
|
|
4598
4598
|
return make;
|
|
4599
4599
|
}
|
|
4600
|
+
const getters = new WeakMap();
|
|
4601
|
+
function get_prop(host, field) {
|
|
4602
|
+
let props = getters.get(host);
|
|
4603
|
+
let get_val = props?.[field];
|
|
4604
|
+
if (get_val)
|
|
4605
|
+
return get_val;
|
|
4606
|
+
get_val = (next) => {
|
|
4607
|
+
if (next !== undefined)
|
|
4608
|
+
host[field] = next;
|
|
4609
|
+
return host[field];
|
|
4610
|
+
};
|
|
4611
|
+
Object.defineProperty(get_val, 'name', { value: field });
|
|
4612
|
+
if (!props) {
|
|
4613
|
+
props = {};
|
|
4614
|
+
getters.set(host, props);
|
|
4615
|
+
}
|
|
4616
|
+
props[field] = get_val;
|
|
4617
|
+
return get_val;
|
|
4618
|
+
}
|
|
4600
4619
|
function $mol_wire_sync(obj) {
|
|
4601
4620
|
return new Proxy(obj, {
|
|
4602
4621
|
get(obj, field) {
|
|
4603
4622
|
let val = obj[field];
|
|
4623
|
+
const temp = $mol_wire_task.getter(typeof val === 'function' ? val : get_prop(obj, field));
|
|
4604
4624
|
if (typeof val !== 'function')
|
|
4605
|
-
return
|
|
4606
|
-
const temp = $mol_wire_task.getter(val);
|
|
4625
|
+
return temp(obj, []).sync();
|
|
4607
4626
|
return function $mol_wire_sync(...args) {
|
|
4608
4627
|
const fiber = temp(obj, args);
|
|
4609
4628
|
return fiber.sync();
|
|
4610
4629
|
};
|
|
4611
4630
|
},
|
|
4631
|
+
set(obj, field, next) {
|
|
4632
|
+
const temp = $mol_wire_task.getter(get_prop(obj, field));
|
|
4633
|
+
temp(obj, [next]).sync();
|
|
4634
|
+
return true;
|
|
4635
|
+
},
|
|
4612
4636
|
construct(obj, args) {
|
|
4613
4637
|
const temp = $mol_wire_task.getter(factory(obj));
|
|
4614
4638
|
return temp(obj, args).sync();
|