mol_wire_lib 1.0.300 → 1.0.301

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.test.js CHANGED
@@ -1363,6 +1363,82 @@ var $;
1363
1363
  ;
1364
1364
  "use strict";
1365
1365
  var $;
1366
+ (function ($_1) {
1367
+ let $$;
1368
+ (function ($$) {
1369
+ let $;
1370
+ })($$ = $_1.$$ || ($_1.$$ = {}));
1371
+ $_1.$mol_object_field = Symbol('$mol_object_field');
1372
+ class $mol_object extends $mol_object2 {
1373
+ static make(config) {
1374
+ return super.create(obj => {
1375
+ for (let key in config)
1376
+ obj[key] = config[key];
1377
+ });
1378
+ }
1379
+ }
1380
+ $_1.$mol_object = $mol_object;
1381
+ })($ || ($ = {}));
1382
+ //mol/object/object.ts
1383
+ ;
1384
+ "use strict";
1385
+ var $;
1386
+ (function ($) {
1387
+ $.$mol_mem = $mol_wire_solo;
1388
+ $.$mol_mem_key = $mol_wire_plex;
1389
+ })($ || ($ = {}));
1390
+ //mol/mem/mem.ts
1391
+ ;
1392
+ "use strict";
1393
+ var $;
1394
+ (function ($) {
1395
+ class $mol_state_time extends $mol_object {
1396
+ static task(precision, reset) {
1397
+ if (precision) {
1398
+ return new $mol_after_timeout(precision, () => this.task(precision, null));
1399
+ }
1400
+ else {
1401
+ return new $mol_after_frame(() => this.task(precision, null));
1402
+ }
1403
+ }
1404
+ static now(precision) {
1405
+ this.task(precision);
1406
+ return Date.now();
1407
+ }
1408
+ }
1409
+ __decorate([
1410
+ $mol_mem_key
1411
+ ], $mol_state_time, "task", null);
1412
+ __decorate([
1413
+ $mol_mem_key
1414
+ ], $mol_state_time, "now", null);
1415
+ $.$mol_state_time = $mol_state_time;
1416
+ })($ || ($ = {}));
1417
+ //mol/state/time/time.ts
1418
+ ;
1419
+ "use strict";
1420
+ var $;
1421
+ (function ($) {
1422
+ function $mol_wire_easing(next) {
1423
+ const atom = $mol_wire_auto();
1424
+ if (!(atom instanceof $mol_wire_atom))
1425
+ $mol_fail(new Error('Allowed only inside atom'));
1426
+ const prev = atom.result() ?? next;
1427
+ if (typeof prev !== 'number')
1428
+ return next;
1429
+ const current = (prev * 2 + next) / 3;
1430
+ const diff = Math.abs(current - next);
1431
+ if (diff < 1)
1432
+ return next;
1433
+ $mol_state_time.now(0);
1434
+ return current;
1435
+ }
1436
+ $.$mol_wire_easing = $mol_wire_easing;
1437
+ })($ || ($ = {}));
1438
+ //mol/wire/easing/easing.ts
1439
+ ;
1440
+ "use strict";
1441
+ var $;
1366
1442
  (function ($) {
1367
1443
  function $mol_wire_patch(obj) {
1368
1444
  for (const field of Reflect.ownKeys(obj)) {
@@ -1568,14 +1644,6 @@ var $;
1568
1644
  ;
1569
1645
  "use strict";
1570
1646
  var $;
1571
- (function ($) {
1572
- $.$mol_mem = $mol_wire_solo;
1573
- $.$mol_mem_key = $mol_wire_plex;
1574
- })($ || ($ = {}));
1575
- //mol/mem/mem.ts
1576
- ;
1577
- "use strict";
1578
- var $;
1579
1647
  (function ($) {
1580
1648
  function $mol_log3_area_lazy(event) {
1581
1649
  const self = this;
@@ -3892,6 +3960,25 @@ var $;
3892
3960
  ;
3893
3961
  "use strict";
3894
3962
  var $;
3963
+ (function ($) {
3964
+ $mol_test({
3965
+ 'init with overload'() {
3966
+ class X extends $mol_object {
3967
+ foo() {
3968
+ return 1;
3969
+ }
3970
+ }
3971
+ var x = X.make({
3972
+ foo: () => 2,
3973
+ });
3974
+ $mol_assert_equal(x.foo(), 2);
3975
+ },
3976
+ });
3977
+ })($ || ($ = {}));
3978
+ //mol/object/object.test.ts
3979
+ ;
3980
+ "use strict";
3981
+ var $;
3895
3982
  (function ($_1) {
3896
3983
  $mol_test({
3897
3984
  'Watch one value'($) {