mol_jsx_lib 0.0.1405 → 0.0.1407

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/web.mjs CHANGED
@@ -1117,10 +1117,12 @@ var $;
1117
1117
  result = wrappers.get(result);
1118
1118
  }
1119
1119
  else {
1120
- wrappers.set(result, result = Object.assign(result.finally(() => {
1120
+ const put = (v) => {
1121
1121
  if (this.cache === result)
1122
1122
  this.absorb();
1123
- }), { destructor: result.destructor || (() => { }) }));
1123
+ return v;
1124
+ };
1125
+ wrappers.set(result, result = Object.assign(result.then(put, put), { destructor: result.destructor || (() => { }) }));
1124
1126
  const error = new Error(`Promise in ${this}`);
1125
1127
  Object.defineProperty(result, 'stack', { get: () => error.stack });
1126
1128
  }
@@ -1714,6 +1716,12 @@ var $;
1714
1716
  $mol_wire_atom.watching.add(this);
1715
1717
  }
1716
1718
  resync(args) {
1719
+ for (let cursor = this.pub_from; cursor < this.sub_from; cursor += 2) {
1720
+ const pub = this.data[cursor];
1721
+ if (pub && pub instanceof $mol_wire_task) {
1722
+ pub.destructor();
1723
+ }
1724
+ }
1717
1725
  return this.put(this.task.call(this.host, ...args));
1718
1726
  }
1719
1727
  once() {