hyoo_sync_client 0.0.475 → 0.0.477

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
@@ -1213,21 +1213,28 @@ var $;
1213
1213
  "use strict";
1214
1214
  var $;
1215
1215
  (function ($) {
1216
- class $mol_after_timeout extends $mol_object2 {
1217
- delay;
1216
+ class $mol_after_tick extends $mol_object2 {
1218
1217
  task;
1219
- id;
1220
- constructor(delay, task) {
1218
+ static promise = null;
1219
+ cancelled = false;
1220
+ constructor(task) {
1221
1221
  super();
1222
- this.delay = delay;
1223
1222
  this.task = task;
1224
- this.id = setTimeout(task, delay);
1223
+ if (!$mol_after_tick.promise)
1224
+ $mol_after_tick.promise = Promise.resolve().then(() => {
1225
+ $mol_after_tick.promise = null;
1226
+ });
1227
+ $mol_after_tick.promise.then(() => {
1228
+ if (this.cancelled)
1229
+ return;
1230
+ task();
1231
+ });
1225
1232
  }
1226
1233
  destructor() {
1227
- clearTimeout(this.id);
1234
+ this.cancelled = true;
1228
1235
  }
1229
1236
  }
1230
- $.$mol_after_timeout = $mol_after_timeout;
1237
+ $.$mol_after_tick = $mol_after_tick;
1231
1238
  })($ || ($ = {}));
1232
1239
 
1233
1240
  ;
@@ -1260,7 +1267,7 @@ var $;
1260
1267
  static plan() {
1261
1268
  if (this.plan_task)
1262
1269
  return;
1263
- this.plan_task = new $mol_after_timeout(0, () => {
1270
+ this.plan_task = new $mol_after_tick(() => {
1264
1271
  try {
1265
1272
  this.sync();
1266
1273
  }
@@ -3552,6 +3559,27 @@ var $;
3552
3559
  $.$mol_promise = $mol_promise;
3553
3560
  })($ || ($ = {}));
3554
3561
 
3562
+ ;
3563
+ "use strict";
3564
+ var $;
3565
+ (function ($) {
3566
+ class $mol_after_timeout extends $mol_object2 {
3567
+ delay;
3568
+ task;
3569
+ id;
3570
+ constructor(delay, task) {
3571
+ super();
3572
+ this.delay = delay;
3573
+ this.task = task;
3574
+ this.id = setTimeout(task, delay);
3575
+ }
3576
+ destructor() {
3577
+ clearTimeout(this.id);
3578
+ }
3579
+ }
3580
+ $.$mol_after_timeout = $mol_after_timeout;
3581
+ })($ || ($ = {}));
3582
+
3555
3583
  ;
3556
3584
  "use strict";
3557
3585
  var $;
package/web.test.js CHANGED
@@ -1244,7 +1244,7 @@ var $;
1244
1244
  var $;
1245
1245
  (function ($_1) {
1246
1246
  $mol_test_mocks.push($ => {
1247
- $.$mol_after_timeout = $mol_after_mock_timeout;
1247
+ $.$mol_after_tick = $mol_after_mock_commmon;
1248
1248
  });
1249
1249
  })($ || ($ = {}));
1250
1250
 
@@ -1333,6 +1333,15 @@ var $;
1333
1333
  ;
1334
1334
  "use strict";
1335
1335
 
1336
+ ;
1337
+ "use strict";
1338
+ var $;
1339
+ (function ($_1) {
1340
+ $mol_test_mocks.push($ => {
1341
+ $.$mol_after_timeout = $mol_after_mock_timeout;
1342
+ });
1343
+ })($ || ($ = {}));
1344
+
1336
1345
  ;
1337
1346
  "use strict";
1338
1347
  var $;