mol_wire_lib 1.0.1015 → 1.0.1017

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
@@ -575,31 +575,14 @@ var $;
575
575
  "use strict";
576
576
  var $;
577
577
  (function ($) {
578
- class $mol_after_frame extends $mol_object2 {
578
+ class $mol_after_tick extends $mol_object2 {
579
579
  task;
580
- static _promise = null;
581
- static get promise() {
582
- if (this._promise)
583
- return this._promise;
584
- return this._promise = new Promise(done => {
585
- const complete = () => {
586
- this._promise = null;
587
- done();
588
- };
589
- if (typeof requestAnimationFrame === 'function') {
590
- requestAnimationFrame(complete);
591
- }
592
- else {
593
- setTimeout(complete, 16);
594
- }
595
- });
596
- }
597
- cancelled = false;
598
580
  promise;
581
+ cancelled = false;
599
582
  constructor(task) {
600
583
  super();
601
584
  this.task = task;
602
- this.promise = $mol_after_frame.promise.then(() => {
585
+ this.promise = Promise.resolve().then(() => {
603
586
  if (this.cancelled)
604
587
  return;
605
588
  task();
@@ -609,7 +592,7 @@ var $;
609
592
  this.cancelled = true;
610
593
  }
611
594
  }
612
- $.$mol_after_frame = $mol_after_frame;
595
+ $.$mol_after_tick = $mol_after_tick;
613
596
  })($ || ($ = {}));
614
597
 
615
598
  ;
@@ -637,7 +620,7 @@ var $;
637
620
  static plan() {
638
621
  if (this.plan_task)
639
622
  return;
640
- this.plan_task = new $mol_after_frame(() => {
623
+ this.plan_task = new $mol_after_tick(() => {
641
624
  try {
642
625
  this.sync();
643
626
  }
@@ -839,7 +822,7 @@ var $;
839
822
  sub.track_off(prev);
840
823
  sub.absorb = () => {
841
824
  done(null);
842
- sub.destructor();
825
+ setTimeout(() => sub.destructor());
843
826
  };
844
827
  });
845
828
  }
@@ -1165,6 +1148,47 @@ var $;
1165
1148
  $.$mol_key = $mol_key;
1166
1149
  })($ || ($ = {}));
1167
1150
 
1151
+ ;
1152
+ "use strict";
1153
+ var $;
1154
+ (function ($) {
1155
+ class $mol_after_frame extends $mol_object2 {
1156
+ task;
1157
+ static _promise = null;
1158
+ static get promise() {
1159
+ if (this._promise)
1160
+ return this._promise;
1161
+ return this._promise = new Promise(done => {
1162
+ const complete = () => {
1163
+ this._promise = null;
1164
+ done();
1165
+ };
1166
+ if (typeof requestAnimationFrame === 'function') {
1167
+ requestAnimationFrame(complete);
1168
+ }
1169
+ else {
1170
+ setTimeout(complete, 16);
1171
+ }
1172
+ });
1173
+ }
1174
+ cancelled = false;
1175
+ promise;
1176
+ constructor(task) {
1177
+ super();
1178
+ this.task = task;
1179
+ this.promise = $mol_after_frame.promise.then(() => {
1180
+ if (this.cancelled)
1181
+ return;
1182
+ task();
1183
+ });
1184
+ }
1185
+ destructor() {
1186
+ this.cancelled = true;
1187
+ }
1188
+ }
1189
+ $.$mol_after_frame = $mol_after_frame;
1190
+ })($ || ($ = {}));
1191
+
1168
1192
  ;
1169
1193
  "use strict";
1170
1194
  var $;
package/web.test.js CHANGED
@@ -1115,7 +1115,7 @@ var $;
1115
1115
  var $;
1116
1116
  (function ($_1) {
1117
1117
  $mol_test_mocks.push($ => {
1118
- $.$mol_after_frame = $mol_after_mock_commmon;
1118
+ $.$mol_after_tick = $mol_after_mock_commmon;
1119
1119
  });
1120
1120
  })($ || ($ = {}));
1121
1121
 
@@ -1262,6 +1262,15 @@ var $;
1262
1262
  });
1263
1263
  })($ || ($ = {}));
1264
1264
 
1265
+ ;
1266
+ "use strict";
1267
+ var $;
1268
+ (function ($_1) {
1269
+ $mol_test_mocks.push($ => {
1270
+ $.$mol_after_frame = $mol_after_mock_commmon;
1271
+ });
1272
+ })($ || ($ = {}));
1273
+
1265
1274
  ;
1266
1275
  "use strict";
1267
1276