mol_wire_lib 1.0.1014 → 1.0.1016

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
@@ -575,35 +575,24 @@ var $;
575
575
  "use strict";
576
576
  var $;
577
577
  (function ($) {
578
- class $mol_after_timeout extends $mol_object2 {
579
- delay;
578
+ class $mol_after_tick extends $mol_object2 {
580
579
  task;
581
- id;
582
- constructor(delay, task) {
580
+ promise;
581
+ cancelled = false;
582
+ constructor(task) {
583
583
  super();
584
- this.delay = delay;
585
584
  this.task = task;
586
- this.id = setTimeout(task, delay);
585
+ this.promise = Promise.resolve().then(() => {
586
+ if (this.cancelled)
587
+ return;
588
+ task();
589
+ });
587
590
  }
588
591
  destructor() {
589
- clearTimeout(this.id);
590
- }
591
- }
592
- $.$mol_after_timeout = $mol_after_timeout;
593
- })($ || ($ = {}));
594
-
595
- ;
596
- "use strict";
597
- var $;
598
- (function ($) {
599
- class $mol_after_frame extends $mol_after_timeout {
600
- task;
601
- constructor(task) {
602
- super(16, task);
603
- this.task = task;
592
+ this.cancelled = true;
604
593
  }
605
594
  }
606
- $.$mol_after_frame = $mol_after_frame;
595
+ $.$mol_after_tick = $mol_after_tick;
607
596
  })($ || ($ = {}));
608
597
 
609
598
  ;
@@ -631,7 +620,7 @@ var $;
631
620
  static plan() {
632
621
  if (this.plan_task)
633
622
  return;
634
- this.plan_task = new $mol_after_frame(() => {
623
+ this.plan_task = new $mol_after_tick(() => {
635
624
  try {
636
625
  this.sync();
637
626
  }
@@ -833,7 +822,7 @@ var $;
833
822
  sub.track_off(prev);
834
823
  sub.absorb = () => {
835
824
  done(null);
836
- sub.destructor();
825
+ setTimeout(() => sub.destructor());
837
826
  };
838
827
  });
839
828
  }
@@ -1620,6 +1609,41 @@ var $;
1620
1609
  $.$mol_key = $mol_key;
1621
1610
  })($ || ($ = {}));
1622
1611
 
1612
+ ;
1613
+ "use strict";
1614
+ var $;
1615
+ (function ($) {
1616
+ class $mol_after_timeout extends $mol_object2 {
1617
+ delay;
1618
+ task;
1619
+ id;
1620
+ constructor(delay, task) {
1621
+ super();
1622
+ this.delay = delay;
1623
+ this.task = task;
1624
+ this.id = setTimeout(task, delay);
1625
+ }
1626
+ destructor() {
1627
+ clearTimeout(this.id);
1628
+ }
1629
+ }
1630
+ $.$mol_after_timeout = $mol_after_timeout;
1631
+ })($ || ($ = {}));
1632
+
1633
+ ;
1634
+ "use strict";
1635
+ var $;
1636
+ (function ($) {
1637
+ class $mol_after_frame extends $mol_after_timeout {
1638
+ task;
1639
+ constructor(task) {
1640
+ super(16, task);
1641
+ this.task = task;
1642
+ }
1643
+ }
1644
+ $.$mol_after_frame = $mol_after_frame;
1645
+ })($ || ($ = {}));
1646
+
1623
1647
  ;
1624
1648
  "use strict";
1625
1649
  var $;
package/node.test.js CHANGED
@@ -566,35 +566,24 @@ var $;
566
566
  "use strict";
567
567
  var $;
568
568
  (function ($) {
569
- class $mol_after_timeout extends $mol_object2 {
570
- delay;
569
+ class $mol_after_tick extends $mol_object2 {
571
570
  task;
572
- id;
573
- constructor(delay, task) {
571
+ promise;
572
+ cancelled = false;
573
+ constructor(task) {
574
574
  super();
575
- this.delay = delay;
576
575
  this.task = task;
577
- this.id = setTimeout(task, delay);
576
+ this.promise = Promise.resolve().then(() => {
577
+ if (this.cancelled)
578
+ return;
579
+ task();
580
+ });
578
581
  }
579
582
  destructor() {
580
- clearTimeout(this.id);
583
+ this.cancelled = true;
581
584
  }
582
585
  }
583
- $.$mol_after_timeout = $mol_after_timeout;
584
- })($ || ($ = {}));
585
-
586
- ;
587
- "use strict";
588
- var $;
589
- (function ($) {
590
- class $mol_after_frame extends $mol_after_timeout {
591
- task;
592
- constructor(task) {
593
- super(16, task);
594
- this.task = task;
595
- }
596
- }
597
- $.$mol_after_frame = $mol_after_frame;
586
+ $.$mol_after_tick = $mol_after_tick;
598
587
  })($ || ($ = {}));
599
588
 
600
589
  ;
@@ -622,7 +611,7 @@ var $;
622
611
  static plan() {
623
612
  if (this.plan_task)
624
613
  return;
625
- this.plan_task = new $mol_after_frame(() => {
614
+ this.plan_task = new $mol_after_tick(() => {
626
615
  try {
627
616
  this.sync();
628
617
  }
@@ -824,7 +813,7 @@ var $;
824
813
  sub.track_off(prev);
825
814
  sub.absorb = () => {
826
815
  done(null);
827
- sub.destructor();
816
+ setTimeout(() => sub.destructor());
828
817
  };
829
818
  });
830
819
  }
@@ -1611,6 +1600,41 @@ var $;
1611
1600
  $.$mol_key = $mol_key;
1612
1601
  })($ || ($ = {}));
1613
1602
 
1603
+ ;
1604
+ "use strict";
1605
+ var $;
1606
+ (function ($) {
1607
+ class $mol_after_timeout extends $mol_object2 {
1608
+ delay;
1609
+ task;
1610
+ id;
1611
+ constructor(delay, task) {
1612
+ super();
1613
+ this.delay = delay;
1614
+ this.task = task;
1615
+ this.id = setTimeout(task, delay);
1616
+ }
1617
+ destructor() {
1618
+ clearTimeout(this.id);
1619
+ }
1620
+ }
1621
+ $.$mol_after_timeout = $mol_after_timeout;
1622
+ })($ || ($ = {}));
1623
+
1624
+ ;
1625
+ "use strict";
1626
+ var $;
1627
+ (function ($) {
1628
+ class $mol_after_frame extends $mol_after_timeout {
1629
+ task;
1630
+ constructor(task) {
1631
+ super(16, task);
1632
+ this.task = task;
1633
+ }
1634
+ }
1635
+ $.$mol_after_frame = $mol_after_frame;
1636
+ })($ || ($ = {}));
1637
+
1614
1638
  ;
1615
1639
  "use strict";
1616
1640
  var $;
@@ -3832,16 +3856,7 @@ var $;
3832
3856
  var $;
3833
3857
  (function ($_1) {
3834
3858
  $mol_test_mocks.push($ => {
3835
- $.$mol_after_timeout = $mol_after_mock_timeout;
3836
- });
3837
- })($ || ($ = {}));
3838
-
3839
- ;
3840
- "use strict";
3841
- var $;
3842
- (function ($_1) {
3843
- $mol_test_mocks.push($ => {
3844
- $.$mol_after_frame = $mol_after_mock_commmon;
3859
+ $.$mol_after_tick = $mol_after_mock_commmon;
3845
3860
  });
3846
3861
  })($ || ($ = {}));
3847
3862
 
@@ -3988,6 +4003,24 @@ var $;
3988
4003
  });
3989
4004
  })($ || ($ = {}));
3990
4005
 
4006
+ ;
4007
+ "use strict";
4008
+ var $;
4009
+ (function ($_1) {
4010
+ $mol_test_mocks.push($ => {
4011
+ $.$mol_after_timeout = $mol_after_mock_timeout;
4012
+ });
4013
+ })($ || ($ = {}));
4014
+
4015
+ ;
4016
+ "use strict";
4017
+ var $;
4018
+ (function ($_1) {
4019
+ $mol_test_mocks.push($ => {
4020
+ $.$mol_after_frame = $mol_after_mock_commmon;
4021
+ });
4022
+ })($ || ($ = {}));
4023
+
3991
4024
  ;
3992
4025
  "use strict";
3993
4026