mol_wire_lib 1.0.260 → 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/node.js CHANGED
@@ -1367,6 +1367,82 @@ var $;
1367
1367
  ;
1368
1368
  "use strict";
1369
1369
  var $;
1370
+ (function ($_1) {
1371
+ let $$;
1372
+ (function ($$) {
1373
+ let $;
1374
+ })($$ = $_1.$$ || ($_1.$$ = {}));
1375
+ $_1.$mol_object_field = Symbol('$mol_object_field');
1376
+ class $mol_object extends $mol_object2 {
1377
+ static make(config) {
1378
+ return super.create(obj => {
1379
+ for (let key in config)
1380
+ obj[key] = config[key];
1381
+ });
1382
+ }
1383
+ }
1384
+ $_1.$mol_object = $mol_object;
1385
+ })($ || ($ = {}));
1386
+ //mol/object/object.ts
1387
+ ;
1388
+ "use strict";
1389
+ var $;
1390
+ (function ($) {
1391
+ $.$mol_mem = $mol_wire_solo;
1392
+ $.$mol_mem_key = $mol_wire_plex;
1393
+ })($ || ($ = {}));
1394
+ //mol/mem/mem.ts
1395
+ ;
1396
+ "use strict";
1397
+ var $;
1398
+ (function ($) {
1399
+ class $mol_state_time extends $mol_object {
1400
+ static task(precision, reset) {
1401
+ if (precision) {
1402
+ return new $mol_after_timeout(precision, () => this.task(precision, null));
1403
+ }
1404
+ else {
1405
+ return new $mol_after_frame(() => this.task(precision, null));
1406
+ }
1407
+ }
1408
+ static now(precision) {
1409
+ this.task(precision);
1410
+ return Date.now();
1411
+ }
1412
+ }
1413
+ __decorate([
1414
+ $mol_mem_key
1415
+ ], $mol_state_time, "task", null);
1416
+ __decorate([
1417
+ $mol_mem_key
1418
+ ], $mol_state_time, "now", null);
1419
+ $.$mol_state_time = $mol_state_time;
1420
+ })($ || ($ = {}));
1421
+ //mol/state/time/time.ts
1422
+ ;
1423
+ "use strict";
1424
+ var $;
1425
+ (function ($) {
1426
+ function $mol_wire_trans(next) {
1427
+ const atom = $mol_wire_auto();
1428
+ if (!(atom instanceof $mol_wire_atom))
1429
+ $mol_fail(new Error('Allowed only inside atom'));
1430
+ const prev = atom.result() ?? next;
1431
+ if (typeof prev !== 'number')
1432
+ return next;
1433
+ const current = (prev * 2 + next) / 3;
1434
+ const diff = Math.abs(current - next);
1435
+ if (diff < 1)
1436
+ return next;
1437
+ $mol_state_time.now(0);
1438
+ return current;
1439
+ }
1440
+ $.$mol_wire_trans = $mol_wire_trans;
1441
+ })($ || ($ = {}));
1442
+ //mol/wire/trans/trans.ts
1443
+ ;
1444
+ "use strict";
1445
+ var $;
1370
1446
  (function ($) {
1371
1447
  function $mol_wire_patch(obj) {
1372
1448
  for (const field of Reflect.ownKeys(obj)) {
@@ -1572,14 +1648,6 @@ var $;
1572
1648
  ;
1573
1649
  "use strict";
1574
1650
  var $;
1575
- (function ($) {
1576
- $.$mol_mem = $mol_wire_solo;
1577
- $.$mol_mem_key = $mol_wire_plex;
1578
- })($ || ($ = {}));
1579
- //mol/mem/mem.ts
1580
- ;
1581
- "use strict";
1582
- var $;
1583
1651
  (function ($) {
1584
1652
  function $mol_log3_area_lazy(event) {
1585
1653
  const self = this;