mol_wire_lib 1.0.1215 → 1.0.1217

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
@@ -809,7 +809,7 @@ var $;
809
809
  }
810
810
  return this.cache;
811
811
  }
812
- async async() {
812
+ async async_raw() {
813
813
  while (true) {
814
814
  this.fresh();
815
815
  if (this.cache instanceof Error) {
@@ -825,6 +825,12 @@ var $;
825
825
  }
826
826
  }
827
827
  }
828
+ async() {
829
+ const promise = this.async_raw();
830
+ if (!promise.destructor)
831
+ promise.destructor = () => this.destructor();
832
+ return promise;
833
+ }
828
834
  step() {
829
835
  return new Promise(done => {
830
836
  const sub = new $mol_wire_pub_sub;
package/node.test.js CHANGED
@@ -800,7 +800,7 @@ var $;
800
800
  }
801
801
  return this.cache;
802
802
  }
803
- async async() {
803
+ async async_raw() {
804
804
  while (true) {
805
805
  this.fresh();
806
806
  if (this.cache instanceof Error) {
@@ -816,6 +816,12 @@ var $;
816
816
  }
817
817
  }
818
818
  }
819
+ async() {
820
+ const promise = this.async_raw();
821
+ if (!promise.destructor)
822
+ promise.destructor = () => this.destructor();
823
+ return promise;
824
+ }
819
825
  step() {
820
826
  return new Promise(done => {
821
827
  const sub = new $mol_wire_pub_sub;