hyoo_sync_client 0.0.526 → 0.0.528
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.d.ts +1 -6
- package/node.d.ts.map +1 -1
- package/node.js.map +1 -1
- package/node.test.js +81 -6
- package/node.test.js.map +1 -1
- package/package.json +1 -1
- package/web.d.ts +1 -6
- package/web.d.ts.map +1 -1
- package/web.js.map +1 -1
- package/web.test.js +81 -6
- package/web.test.js.map +1 -1
package/web.test.js
CHANGED
|
@@ -1364,7 +1364,7 @@ var $;
|
|
|
1364
1364
|
static last = [];
|
|
1365
1365
|
static send(next) {
|
|
1366
1366
|
$mol_wire_sync(this.first).push(next);
|
|
1367
|
-
|
|
1367
|
+
$$.$mol_wait_timeout(0);
|
|
1368
1368
|
this.last.push(next);
|
|
1369
1369
|
}
|
|
1370
1370
|
}
|
|
@@ -1373,15 +1373,15 @@ var $;
|
|
|
1373
1373
|
const promise = name('jin');
|
|
1374
1374
|
$.$mol_after_mock_warp();
|
|
1375
1375
|
await promise;
|
|
1376
|
-
$
|
|
1377
|
-
$
|
|
1376
|
+
$mol_assert_equal(NameLogger.first, ['john', 'jin']);
|
|
1377
|
+
$mol_assert_equal(NameLogger.last, ['jin']);
|
|
1378
1378
|
},
|
|
1379
1379
|
async 'Latest function calls wins'($) {
|
|
1380
1380
|
const first = [];
|
|
1381
1381
|
const last = [];
|
|
1382
1382
|
function send_name(next) {
|
|
1383
1383
|
$mol_wire_sync(first).push(next);
|
|
1384
|
-
|
|
1384
|
+
$$.$mol_wait_timeout(0);
|
|
1385
1385
|
last.push(next);
|
|
1386
1386
|
}
|
|
1387
1387
|
const name = $mol_wire_async(send_name);
|
|
@@ -1389,8 +1389,8 @@ var $;
|
|
|
1389
1389
|
const promise = name('jin');
|
|
1390
1390
|
$.$mol_after_mock_warp();
|
|
1391
1391
|
await promise;
|
|
1392
|
-
$
|
|
1393
|
-
$
|
|
1392
|
+
$mol_assert_equal(first, ['john', 'jin']);
|
|
1393
|
+
$mol_assert_equal(last, ['jin']);
|
|
1394
1394
|
},
|
|
1395
1395
|
});
|
|
1396
1396
|
})($ || ($ = {}));
|
|
@@ -1448,6 +1448,81 @@ var $;
|
|
|
1448
1448
|
});
|
|
1449
1449
|
})($ || ($ = {}));
|
|
1450
1450
|
|
|
1451
|
+
;
|
|
1452
|
+
"use strict";
|
|
1453
|
+
var $;
|
|
1454
|
+
(function ($) {
|
|
1455
|
+
class $mol_after_work extends $mol_object2 {
|
|
1456
|
+
delay;
|
|
1457
|
+
task;
|
|
1458
|
+
id;
|
|
1459
|
+
constructor(delay, task) {
|
|
1460
|
+
super();
|
|
1461
|
+
this.delay = delay;
|
|
1462
|
+
this.task = task;
|
|
1463
|
+
this.id = requestIdleCallback(task, { timeout: delay });
|
|
1464
|
+
}
|
|
1465
|
+
destructor() {
|
|
1466
|
+
cancelIdleCallback(this.id);
|
|
1467
|
+
}
|
|
1468
|
+
}
|
|
1469
|
+
$.$mol_after_work = $mol_after_work;
|
|
1470
|
+
if (typeof requestIdleCallback !== 'function') {
|
|
1471
|
+
$.$mol_after_work = $mol_after_timeout;
|
|
1472
|
+
}
|
|
1473
|
+
})($ || ($ = {}));
|
|
1474
|
+
|
|
1475
|
+
;
|
|
1476
|
+
"use strict";
|
|
1477
|
+
var $;
|
|
1478
|
+
(function ($_1) {
|
|
1479
|
+
$mol_test_mocks.push($ => {
|
|
1480
|
+
$.$mol_after_work = $mol_after_mock_timeout;
|
|
1481
|
+
});
|
|
1482
|
+
})($ || ($ = {}));
|
|
1483
|
+
|
|
1484
|
+
;
|
|
1485
|
+
"use strict";
|
|
1486
|
+
var $;
|
|
1487
|
+
(function ($) {
|
|
1488
|
+
function $mol_wait_rest_async() {
|
|
1489
|
+
return new Promise(done => {
|
|
1490
|
+
new this.$mol_after_work(16, () => done(null));
|
|
1491
|
+
});
|
|
1492
|
+
}
|
|
1493
|
+
$.$mol_wait_rest_async = $mol_wait_rest_async;
|
|
1494
|
+
function $mol_wait_rest() {
|
|
1495
|
+
return this.$mol_wire_sync(this).$mol_wait_rest_async();
|
|
1496
|
+
}
|
|
1497
|
+
$.$mol_wait_rest = $mol_wait_rest;
|
|
1498
|
+
})($ || ($ = {}));
|
|
1499
|
+
|
|
1500
|
+
;
|
|
1501
|
+
"use strict";
|
|
1502
|
+
var $;
|
|
1503
|
+
(function ($_1) {
|
|
1504
|
+
var $$;
|
|
1505
|
+
(function ($$) {
|
|
1506
|
+
$mol_test_mocks.push($ => {
|
|
1507
|
+
$.$mol_wait_timeout = function $mol_wait_timeout_mock(timeout) { };
|
|
1508
|
+
$.$mol_wait_timeout_async = async function $mol_wait_timeout_async_mock(timeout) { };
|
|
1509
|
+
});
|
|
1510
|
+
})($$ = $_1.$$ || ($_1.$$ = {}));
|
|
1511
|
+
})($ || ($ = {}));
|
|
1512
|
+
|
|
1513
|
+
;
|
|
1514
|
+
"use strict";
|
|
1515
|
+
var $;
|
|
1516
|
+
(function ($_1) {
|
|
1517
|
+
var $$;
|
|
1518
|
+
(function ($$) {
|
|
1519
|
+
$mol_test_mocks.push($ => {
|
|
1520
|
+
$.$mol_wait_rest = function $mol_wait_rest_mock() { };
|
|
1521
|
+
$.$mol_wait_rest_async = async function $mol_wait_rest_async_mock() { };
|
|
1522
|
+
});
|
|
1523
|
+
})($$ = $_1.$$ || ($_1.$$ = {}));
|
|
1524
|
+
})($ || ($ = {}));
|
|
1525
|
+
|
|
1451
1526
|
;
|
|
1452
1527
|
"use strict";
|
|
1453
1528
|
var $;
|