mol_wire_dom 0.0.1524 → 0.0.1526

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
@@ -887,10 +887,12 @@ var $;
887
887
  result = wrappers.get(result);
888
888
  }
889
889
  else {
890
- wrappers.set(result, result = Object.assign(result.finally(() => {
890
+ const put = (v) => {
891
891
  if (this.cache === result)
892
892
  this.absorb();
893
- }), { destructor: result.destructor || (() => { }) }));
893
+ return v;
894
+ };
895
+ wrappers.set(result, result = Object.assign(result.then(put, put), { destructor: result.destructor || (() => { }) }));
894
896
  const error = new Error(`Promise in ${this}`);
895
897
  Object.defineProperty(result, 'stack', { get: () => error.stack });
896
898
  }
@@ -1484,6 +1486,12 @@ var $;
1484
1486
  $mol_wire_atom.watching.add(this);
1485
1487
  }
1486
1488
  resync(args) {
1489
+ for (let cursor = this.pub_from; cursor < this.sub_from; cursor += 2) {
1490
+ const pub = this.data[cursor];
1491
+ if (pub && pub instanceof $mol_wire_task) {
1492
+ pub.destructor();
1493
+ }
1494
+ }
1487
1495
  return this.put(this.task.call(this.host, ...args));
1488
1496
  }
1489
1497
  once() {