hyoo_sync_client 0.0.419 → 0.0.421

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,31 +1213,14 @@ var $;
1213
1213
  "use strict";
1214
1214
  var $;
1215
1215
  (function ($) {
1216
- class $mol_after_frame extends $mol_object2 {
1216
+ class $mol_after_tick extends $mol_object2 {
1217
1217
  task;
1218
- static _promise = null;
1219
- static get promise() {
1220
- if (this._promise)
1221
- return this._promise;
1222
- return this._promise = new Promise(done => {
1223
- const complete = () => {
1224
- this._promise = null;
1225
- done();
1226
- };
1227
- if (typeof requestAnimationFrame === 'function') {
1228
- requestAnimationFrame(complete);
1229
- }
1230
- else {
1231
- setTimeout(complete, 16);
1232
- }
1233
- });
1234
- }
1235
- cancelled = false;
1236
1218
  promise;
1219
+ cancelled = false;
1237
1220
  constructor(task) {
1238
1221
  super();
1239
1222
  this.task = task;
1240
- this.promise = $mol_after_frame.promise.then(() => {
1223
+ this.promise = Promise.resolve().then(() => {
1241
1224
  if (this.cancelled)
1242
1225
  return;
1243
1226
  task();
@@ -1247,7 +1230,7 @@ var $;
1247
1230
  this.cancelled = true;
1248
1231
  }
1249
1232
  }
1250
- $.$mol_after_frame = $mol_after_frame;
1233
+ $.$mol_after_tick = $mol_after_tick;
1251
1234
  })($ || ($ = {}));
1252
1235
 
1253
1236
  ;
@@ -1275,7 +1258,7 @@ var $;
1275
1258
  static plan() {
1276
1259
  if (this.plan_task)
1277
1260
  return;
1278
- this.plan_task = new $mol_after_frame(() => {
1261
+ this.plan_task = new $mol_after_tick(() => {
1279
1262
  try {
1280
1263
  this.sync();
1281
1264
  }
@@ -1477,7 +1460,7 @@ var $;
1477
1460
  sub.track_off(prev);
1478
1461
  sub.absorb = () => {
1479
1462
  done(null);
1480
- sub.destructor();
1463
+ setTimeout(() => sub.destructor());
1481
1464
  };
1482
1465
  });
1483
1466
  }
@@ -1547,6 +1530,47 @@ var $;
1547
1530
  $.$mol_key = $mol_key;
1548
1531
  })($ || ($ = {}));
1549
1532
 
1533
+ ;
1534
+ "use strict";
1535
+ var $;
1536
+ (function ($) {
1537
+ class $mol_after_frame extends $mol_object2 {
1538
+ task;
1539
+ static _promise = null;
1540
+ static get promise() {
1541
+ if (this._promise)
1542
+ return this._promise;
1543
+ return this._promise = new Promise(done => {
1544
+ const complete = () => {
1545
+ this._promise = null;
1546
+ done();
1547
+ };
1548
+ if (typeof requestAnimationFrame === 'function') {
1549
+ requestAnimationFrame(complete);
1550
+ }
1551
+ else {
1552
+ setTimeout(complete, 16);
1553
+ }
1554
+ });
1555
+ }
1556
+ cancelled = false;
1557
+ promise;
1558
+ constructor(task) {
1559
+ super();
1560
+ this.task = task;
1561
+ this.promise = $mol_after_frame.promise.then(() => {
1562
+ if (this.cancelled)
1563
+ return;
1564
+ task();
1565
+ });
1566
+ }
1567
+ destructor() {
1568
+ this.cancelled = true;
1569
+ }
1570
+ }
1571
+ $.$mol_after_frame = $mol_after_frame;
1572
+ })($ || ($ = {}));
1573
+
1550
1574
  ;
1551
1575
  "use strict";
1552
1576
  var $;
package/web.test.js CHANGED
@@ -1230,7 +1230,7 @@ var $;
1230
1230
  var $;
1231
1231
  (function ($_1) {
1232
1232
  $mol_test_mocks.push($ => {
1233
- $.$mol_after_frame = $mol_after_mock_commmon;
1233
+ $.$mol_after_tick = $mol_after_mock_commmon;
1234
1234
  });
1235
1235
  })($ || ($ = {}));
1236
1236
 
@@ -4253,6 +4253,15 @@ var $;
4253
4253
  ];
4254
4254
  })($ || ($ = {}));
4255
4255
 
4256
+ ;
4257
+ "use strict";
4258
+ var $;
4259
+ (function ($_1) {
4260
+ $mol_test_mocks.push($ => {
4261
+ $.$mol_after_frame = $mol_after_mock_commmon;
4262
+ });
4263
+ })($ || ($ = {}));
4264
+
4256
4265
  ;
4257
4266
  "use strict";
4258
4267