mol_jsx_lib 0.0.881 → 0.0.882

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
@@ -798,31 +798,14 @@ var $;
798
798
  "use strict";
799
799
  var $;
800
800
  (function ($) {
801
- class $mol_after_frame extends $mol_object2 {
801
+ class $mol_after_tick extends $mol_object2 {
802
802
  task;
803
- static _promise = null;
804
- static get promise() {
805
- if (this._promise)
806
- return this._promise;
807
- return this._promise = new Promise(done => {
808
- const complete = () => {
809
- this._promise = null;
810
- done();
811
- };
812
- if (typeof requestAnimationFrame === 'function') {
813
- requestAnimationFrame(complete);
814
- }
815
- else {
816
- setTimeout(complete, 16);
817
- }
818
- });
819
- }
820
- cancelled = false;
821
803
  promise;
804
+ cancelled = false;
822
805
  constructor(task) {
823
806
  super();
824
807
  this.task = task;
825
- this.promise = $mol_after_frame.promise.then(() => {
808
+ this.promise = Promise.resolve().then(() => {
826
809
  if (this.cancelled)
827
810
  return;
828
811
  task();
@@ -832,7 +815,7 @@ var $;
832
815
  this.cancelled = true;
833
816
  }
834
817
  }
835
- $.$mol_after_frame = $mol_after_frame;
818
+ $.$mol_after_tick = $mol_after_tick;
836
819
  })($ || ($ = {}));
837
820
 
838
821
  ;
@@ -860,7 +843,7 @@ var $;
860
843
  static plan() {
861
844
  if (this.plan_task)
862
845
  return;
863
- this.plan_task = new $mol_after_frame(() => {
846
+ this.plan_task = new $mol_after_tick(() => {
864
847
  try {
865
848
  this.sync();
866
849
  }
@@ -1062,7 +1045,7 @@ var $;
1062
1045
  sub.track_off(prev);
1063
1046
  sub.absorb = () => {
1064
1047
  done(null);
1065
- sub.destructor();
1048
+ setTimeout(() => sub.destructor());
1066
1049
  };
1067
1050
  });
1068
1051
  }
@@ -1132,6 +1115,47 @@ var $;
1132
1115
  $.$mol_key = $mol_key;
1133
1116
  })($ || ($ = {}));
1134
1117
 
1118
+ ;
1119
+ "use strict";
1120
+ var $;
1121
+ (function ($) {
1122
+ class $mol_after_frame extends $mol_object2 {
1123
+ task;
1124
+ static _promise = null;
1125
+ static get promise() {
1126
+ if (this._promise)
1127
+ return this._promise;
1128
+ return this._promise = new Promise(done => {
1129
+ const complete = () => {
1130
+ this._promise = null;
1131
+ done();
1132
+ };
1133
+ if (typeof requestAnimationFrame === 'function') {
1134
+ requestAnimationFrame(complete);
1135
+ }
1136
+ else {
1137
+ setTimeout(complete, 16);
1138
+ }
1139
+ });
1140
+ }
1141
+ cancelled = false;
1142
+ promise;
1143
+ constructor(task) {
1144
+ super();
1145
+ this.task = task;
1146
+ this.promise = $mol_after_frame.promise.then(() => {
1147
+ if (this.cancelled)
1148
+ return;
1149
+ task();
1150
+ });
1151
+ }
1152
+ destructor() {
1153
+ this.cancelled = true;
1154
+ }
1155
+ }
1156
+ $.$mol_after_frame = $mol_after_frame;
1157
+ })($ || ($ = {}));
1158
+
1135
1159
  ;
1136
1160
  "use strict";
1137
1161
  var $;
package/web.test.js CHANGED
@@ -565,7 +565,7 @@ var $;
565
565
  var $;
566
566
  (function ($_1) {
567
567
  $mol_test_mocks.push($ => {
568
- $.$mol_after_frame = $mol_after_mock_commmon;
568
+ $.$mol_after_tick = $mol_after_mock_commmon;
569
569
  });
570
570
  })($ || ($ = {}));
571
571
 
@@ -712,6 +712,15 @@ var $;
712
712
  });
713
713
  })($ || ($ = {}));
714
714
 
715
+ ;
716
+ "use strict";
717
+ var $;
718
+ (function ($_1) {
719
+ $mol_test_mocks.push($ => {
720
+ $.$mol_after_frame = $mol_after_mock_commmon;
721
+ });
722
+ })($ || ($ = {}));
723
+
715
724
  ;
716
725
  "use strict";
717
726
  var $;