mol_view_tree2_lib 1.0.1 → 1.0.3

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.mjs CHANGED
@@ -2933,10 +2933,12 @@ var $;
2933
2933
  result = wrappers.get(result);
2934
2934
  }
2935
2935
  else {
2936
- wrappers.set(result, result = Object.assign(result.finally(() => {
2936
+ const put = (v) => {
2937
2937
  if (this.cache === result)
2938
2938
  this.absorb();
2939
- }), { destructor: result.destructor || (() => { }) }));
2939
+ return v;
2940
+ };
2941
+ wrappers.set(result, result = Object.assign(result.then(put, put), { destructor: result.destructor || (() => { }) }));
2940
2942
  const error = new Error(`Promise in ${this}`);
2941
2943
  Object.defineProperty(result, 'stack', { get: () => error.stack });
2942
2944
  }
@@ -3551,6 +3553,12 @@ var $;
3551
3553
  $mol_wire_atom.watching.add(this);
3552
3554
  }
3553
3555
  resync(args) {
3556
+ for (let cursor = this.pub_from; cursor < this.sub_from; cursor += 2) {
3557
+ const pub = this.data[cursor];
3558
+ if (pub && pub instanceof $mol_wire_task) {
3559
+ pub.destructor();
3560
+ }
3561
+ }
3554
3562
  return this.put(this.task.call(this.host, ...args));
3555
3563
  }
3556
3564
  once() {
package/node.test.js CHANGED
@@ -2924,10 +2924,12 @@ var $;
2924
2924
  result = wrappers.get(result);
2925
2925
  }
2926
2926
  else {
2927
- wrappers.set(result, result = Object.assign(result.finally(() => {
2927
+ const put = (v) => {
2928
2928
  if (this.cache === result)
2929
2929
  this.absorb();
2930
- }), { destructor: result.destructor || (() => { }) }));
2930
+ return v;
2931
+ };
2932
+ wrappers.set(result, result = Object.assign(result.then(put, put), { destructor: result.destructor || (() => { }) }));
2931
2933
  const error = new Error(`Promise in ${this}`);
2932
2934
  Object.defineProperty(result, 'stack', { get: () => error.stack });
2933
2935
  }
@@ -3542,6 +3544,12 @@ var $;
3542
3544
  $mol_wire_atom.watching.add(this);
3543
3545
  }
3544
3546
  resync(args) {
3547
+ for (let cursor = this.pub_from; cursor < this.sub_from; cursor += 2) {
3548
+ const pub = this.data[cursor];
3549
+ if (pub && pub instanceof $mol_wire_task) {
3550
+ pub.destructor();
3551
+ }
3552
+ }
3545
3553
  return this.put(this.task.call(this.host, ...args));
3546
3554
  }
3547
3555
  once() {