mol_wire_lib 1.0.262 → 1.0.263

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.js CHANGED
@@ -1373,6 +1373,103 @@ var $;
1373
1373
  ;
1374
1374
  "use strict";
1375
1375
  var $;
1376
+ (function ($_1) {
1377
+ let $$;
1378
+ (function ($$) {
1379
+ let $;
1380
+ })($$ = $_1.$$ || ($_1.$$ = {}));
1381
+ $_1.$mol_object_field = Symbol('$mol_object_field');
1382
+ class $mol_object extends $mol_object2 {
1383
+ static make(config) {
1384
+ return super.create(obj => {
1385
+ for (let key in config)
1386
+ obj[key] = config[key];
1387
+ });
1388
+ }
1389
+ }
1390
+ $_1.$mol_object = $mol_object;
1391
+ })($ || ($ = {}));
1392
+ //mol/object/object.ts
1393
+ ;
1394
+ "use strict";
1395
+ var $;
1396
+ (function ($) {
1397
+ $.$mol_mem = $mol_wire_solo;
1398
+ $.$mol_mem_key = $mol_wire_plex;
1399
+ })($ || ($ = {}));
1400
+ //mol/mem/mem.ts
1401
+ ;
1402
+ "use strict";
1403
+ var $;
1404
+ (function ($) {
1405
+ class $mol_after_timeout extends $mol_object2 {
1406
+ delay;
1407
+ task;
1408
+ id;
1409
+ constructor(delay, task) {
1410
+ super();
1411
+ this.delay = delay;
1412
+ this.task = task;
1413
+ this.id = setTimeout(task, delay);
1414
+ }
1415
+ destructor() {
1416
+ clearTimeout(this.id);
1417
+ }
1418
+ }
1419
+ $.$mol_after_timeout = $mol_after_timeout;
1420
+ })($ || ($ = {}));
1421
+ //mol/after/timeout/timeout.ts
1422
+ ;
1423
+ "use strict";
1424
+ var $;
1425
+ (function ($) {
1426
+ class $mol_state_time extends $mol_object {
1427
+ static task(precision, reset) {
1428
+ if (precision) {
1429
+ return new $mol_after_timeout(precision, () => this.task(precision, null));
1430
+ }
1431
+ else {
1432
+ return new $mol_after_frame(() => this.task(precision, null));
1433
+ }
1434
+ }
1435
+ static now(precision) {
1436
+ this.task(precision);
1437
+ return Date.now();
1438
+ }
1439
+ }
1440
+ __decorate([
1441
+ $mol_mem_key
1442
+ ], $mol_state_time, "task", null);
1443
+ __decorate([
1444
+ $mol_mem_key
1445
+ ], $mol_state_time, "now", null);
1446
+ $.$mol_state_time = $mol_state_time;
1447
+ })($ || ($ = {}));
1448
+ //mol/state/time/time.ts
1449
+ ;
1450
+ "use strict";
1451
+ var $;
1452
+ (function ($) {
1453
+ function $mol_wire_trans(next) {
1454
+ const atom = $mol_wire_auto();
1455
+ if (!(atom instanceof $mol_wire_atom))
1456
+ $mol_fail(new Error('Allowed only inside atom'));
1457
+ const prev = atom.result() ?? next;
1458
+ if (typeof prev !== 'number')
1459
+ return next;
1460
+ const current = (prev * 2 + next) / 3;
1461
+ const diff = Math.abs(current - next);
1462
+ if (diff < 1)
1463
+ return next;
1464
+ $mol_state_time.now(0);
1465
+ return current;
1466
+ }
1467
+ $.$mol_wire_trans = $mol_wire_trans;
1468
+ })($ || ($ = {}));
1469
+ //mol/wire/trans/trans.ts
1470
+ ;
1471
+ "use strict";
1472
+ var $;
1376
1473
  (function ($) {
1377
1474
  function $mol_wire_patch(obj) {
1378
1475
  for (const field of Reflect.ownKeys(obj)) {
@@ -1560,27 +1657,6 @@ var $;
1560
1657
  ;
1561
1658
  "use strict";
1562
1659
  var $;
1563
- (function ($) {
1564
- class $mol_after_timeout extends $mol_object2 {
1565
- delay;
1566
- task;
1567
- id;
1568
- constructor(delay, task) {
1569
- super();
1570
- this.delay = delay;
1571
- this.task = task;
1572
- this.id = setTimeout(task, delay);
1573
- }
1574
- destructor() {
1575
- clearTimeout(this.id);
1576
- }
1577
- }
1578
- $.$mol_after_timeout = $mol_after_timeout;
1579
- })($ || ($ = {}));
1580
- //mol/after/timeout/timeout.ts
1581
- ;
1582
- "use strict";
1583
- var $;
1584
1660
  (function ($) {
1585
1661
  function $mol_wait_timeout_async(timeout) {
1586
1662
  const promise = $mol_promise();
@@ -1599,14 +1675,6 @@ var $;
1599
1675
  ;
1600
1676
  "use strict";
1601
1677
  var $;
1602
- (function ($) {
1603
- $.$mol_mem = $mol_wire_solo;
1604
- $.$mol_mem_key = $mol_wire_plex;
1605
- })($ || ($ = {}));
1606
- //mol/mem/mem.ts
1607
- ;
1608
- "use strict";
1609
- var $;
1610
1678
  (function ($) {
1611
1679
  function $mol_log3_area_lazy(event) {
1612
1680
  const self = this;