mol_wire_lib 1.0.90 → 1.0.91

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
@@ -361,183 +361,6 @@ var $;
361
361
  ;
362
362
  "use strict";
363
363
  var $;
364
- (function ($) {
365
- $.$mol_compare_deep_cache = new WeakMap();
366
- function $mol_compare_deep(left, right) {
367
- if (Object.is(left, right))
368
- return true;
369
- if (left === null)
370
- return false;
371
- if (right === null)
372
- return false;
373
- if (typeof left !== 'object')
374
- return false;
375
- if (typeof right !== 'object')
376
- return false;
377
- const left_proto = Reflect.getPrototypeOf(left);
378
- const right_proto = Reflect.getPrototypeOf(right);
379
- if (left_proto !== right_proto)
380
- return false;
381
- if (left instanceof Boolean)
382
- return Object.is(left.valueOf(), right['valueOf']());
383
- if (left instanceof Number)
384
- return Object.is(left.valueOf(), right['valueOf']());
385
- if (left instanceof String)
386
- return Object.is(left.valueOf(), right['valueOf']());
387
- if (left instanceof Date)
388
- return Object.is(left.valueOf(), right['valueOf']());
389
- if (left instanceof RegExp)
390
- return left.source === right['source'] && left.flags === right['flags'];
391
- let left_cache = $.$mol_compare_deep_cache.get(left);
392
- if (left_cache) {
393
- const right_cache = left_cache.get(right);
394
- if (typeof right_cache === 'boolean')
395
- return right_cache;
396
- }
397
- else {
398
- left_cache = new WeakMap([[right, true]]);
399
- $.$mol_compare_deep_cache.set(left, left_cache);
400
- }
401
- let result;
402
- try {
403
- if (left_proto && !Reflect.getPrototypeOf(left_proto))
404
- result = compare_pojo(left, right);
405
- else if (Array.isArray(left))
406
- result = compare_array(left, right);
407
- else if (left instanceof Set)
408
- result = compare_set(left, right);
409
- else if (left instanceof Map)
410
- result = compare_map(left, right);
411
- else if (left instanceof Error)
412
- result = left.stack === right.stack;
413
- else if (ArrayBuffer.isView(left))
414
- result = compare_buffer(left, right);
415
- else if (Symbol.toPrimitive in left)
416
- result = compare_primitive(left, right);
417
- else
418
- result = false;
419
- }
420
- finally {
421
- left_cache.set(right, result);
422
- }
423
- return result;
424
- }
425
- $.$mol_compare_deep = $mol_compare_deep;
426
- function compare_array(left, right) {
427
- const len = left.length;
428
- if (len !== right.length)
429
- return false;
430
- for (let i = 0; i < len; ++i) {
431
- if (!$mol_compare_deep(left[i], right[i]))
432
- return false;
433
- }
434
- return true;
435
- }
436
- function compare_buffer(left, right) {
437
- const len = left.byteLength;
438
- if (len !== right.byteLength)
439
- return false;
440
- for (let i = 0; i < len; ++i) {
441
- if (left[i] !== right[i])
442
- return false;
443
- }
444
- return true;
445
- }
446
- function compare_iterator(left, right, compare) {
447
- while (true) {
448
- const left_next = left.next();
449
- const right_next = right.next();
450
- if (left_next.done !== right_next.done)
451
- return false;
452
- if (left_next.done)
453
- break;
454
- if (!compare(left_next.value, right_next.value))
455
- return false;
456
- }
457
- return true;
458
- }
459
- function compare_set(left, right) {
460
- if (left.size !== right.size)
461
- return false;
462
- return compare_iterator(left.values(), right.values(), $mol_compare_deep);
463
- }
464
- function compare_map(left, right) {
465
- if (left.size !== right.size)
466
- return false;
467
- return compare_iterator(left.keys(), right.keys(), Object.is)
468
- && compare_iterator(left.values(), right.values(), $mol_compare_deep);
469
- }
470
- function compare_pojo(left, right) {
471
- const left_keys = Object.getOwnPropertyNames(left);
472
- const right_keys = Object.getOwnPropertyNames(right);
473
- if (left_keys.length !== right_keys.length)
474
- return false;
475
- for (let key of left_keys) {
476
- if (!$mol_compare_deep(left[key], Reflect.get(right, key)))
477
- return false;
478
- }
479
- return true;
480
- }
481
- function compare_primitive(left, right) {
482
- return Object.is(left[Symbol.toPrimitive]('default'), right[Symbol.toPrimitive]('default'));
483
- }
484
- })($ || ($ = {}));
485
- //mol/compare/deep/deep.ts
486
- ;
487
- "use strict";
488
- var $;
489
- (function ($) {
490
- function $mol_guid(length = 8, exists = () => false) {
491
- for (;;) {
492
- let id = Math.random().toString(36).substring(2, length + 2).toUpperCase();
493
- if (exists(id))
494
- continue;
495
- return id;
496
- }
497
- }
498
- $.$mol_guid = $mol_guid;
499
- })($ || ($ = {}));
500
- //mol/guid/guid.ts
501
- ;
502
- "use strict";
503
- var $;
504
- (function ($) {
505
- $.$mol_key_store = new WeakMap();
506
- function $mol_key(value) {
507
- if (!value)
508
- return JSON.stringify(value);
509
- if (typeof value !== 'object' && typeof value !== 'function')
510
- return JSON.stringify(value);
511
- return JSON.stringify(value, (field, value) => {
512
- if (!value)
513
- return value;
514
- if (typeof value !== 'object' && typeof value !== 'function')
515
- return value;
516
- if (Array.isArray(value))
517
- return value;
518
- const proto = Reflect.getPrototypeOf(value);
519
- if (!proto)
520
- return value;
521
- if (Reflect.getPrototypeOf(proto) === null)
522
- return value;
523
- if ('toJSON' in value)
524
- return value;
525
- if (value instanceof RegExp)
526
- return value.toString();
527
- let key = $.$mol_key_store.get(value);
528
- if (key)
529
- return key;
530
- key = $mol_guid();
531
- $.$mol_key_store.set(value, key);
532
- return key;
533
- });
534
- }
535
- $.$mol_key = $mol_key;
536
- })($ || ($ = {}));
537
- //mol/key/key.ts
538
- ;
539
- "use strict";
540
- var $;
541
364
  (function ($) {
542
365
  $.$mol_ambient_ref = Symbol('$mol_ambient_ref');
543
366
  function $mol_ambient(overrides) {
@@ -733,6 +556,183 @@ var $;
733
556
  ;
734
557
  "use strict";
735
558
  var $;
559
+ (function ($) {
560
+ $.$mol_compare_deep_cache = new WeakMap();
561
+ function $mol_compare_deep(left, right) {
562
+ if (Object.is(left, right))
563
+ return true;
564
+ if (left === null)
565
+ return false;
566
+ if (right === null)
567
+ return false;
568
+ if (typeof left !== 'object')
569
+ return false;
570
+ if (typeof right !== 'object')
571
+ return false;
572
+ const left_proto = Reflect.getPrototypeOf(left);
573
+ const right_proto = Reflect.getPrototypeOf(right);
574
+ if (left_proto !== right_proto)
575
+ return false;
576
+ if (left instanceof Boolean)
577
+ return Object.is(left.valueOf(), right['valueOf']());
578
+ if (left instanceof Number)
579
+ return Object.is(left.valueOf(), right['valueOf']());
580
+ if (left instanceof String)
581
+ return Object.is(left.valueOf(), right['valueOf']());
582
+ if (left instanceof Date)
583
+ return Object.is(left.valueOf(), right['valueOf']());
584
+ if (left instanceof RegExp)
585
+ return left.source === right['source'] && left.flags === right['flags'];
586
+ let left_cache = $.$mol_compare_deep_cache.get(left);
587
+ if (left_cache) {
588
+ const right_cache = left_cache.get(right);
589
+ if (typeof right_cache === 'boolean')
590
+ return right_cache;
591
+ }
592
+ else {
593
+ left_cache = new WeakMap([[right, true]]);
594
+ $.$mol_compare_deep_cache.set(left, left_cache);
595
+ }
596
+ let result;
597
+ try {
598
+ if (left_proto && !Reflect.getPrototypeOf(left_proto))
599
+ result = compare_pojo(left, right);
600
+ else if (Array.isArray(left))
601
+ result = compare_array(left, right);
602
+ else if (left instanceof Set)
603
+ result = compare_set(left, right);
604
+ else if (left instanceof Map)
605
+ result = compare_map(left, right);
606
+ else if (left instanceof Error)
607
+ result = left.stack === right.stack;
608
+ else if (ArrayBuffer.isView(left))
609
+ result = compare_buffer(left, right);
610
+ else if (Symbol.toPrimitive in left)
611
+ result = compare_primitive(left, right);
612
+ else
613
+ result = false;
614
+ }
615
+ finally {
616
+ left_cache.set(right, result);
617
+ }
618
+ return result;
619
+ }
620
+ $.$mol_compare_deep = $mol_compare_deep;
621
+ function compare_array(left, right) {
622
+ const len = left.length;
623
+ if (len !== right.length)
624
+ return false;
625
+ for (let i = 0; i < len; ++i) {
626
+ if (!$mol_compare_deep(left[i], right[i]))
627
+ return false;
628
+ }
629
+ return true;
630
+ }
631
+ function compare_buffer(left, right) {
632
+ const len = left.byteLength;
633
+ if (len !== right.byteLength)
634
+ return false;
635
+ for (let i = 0; i < len; ++i) {
636
+ if (left[i] !== right[i])
637
+ return false;
638
+ }
639
+ return true;
640
+ }
641
+ function compare_iterator(left, right, compare) {
642
+ while (true) {
643
+ const left_next = left.next();
644
+ const right_next = right.next();
645
+ if (left_next.done !== right_next.done)
646
+ return false;
647
+ if (left_next.done)
648
+ break;
649
+ if (!compare(left_next.value, right_next.value))
650
+ return false;
651
+ }
652
+ return true;
653
+ }
654
+ function compare_set(left, right) {
655
+ if (left.size !== right.size)
656
+ return false;
657
+ return compare_iterator(left.values(), right.values(), $mol_compare_deep);
658
+ }
659
+ function compare_map(left, right) {
660
+ if (left.size !== right.size)
661
+ return false;
662
+ return compare_iterator(left.keys(), right.keys(), Object.is)
663
+ && compare_iterator(left.values(), right.values(), $mol_compare_deep);
664
+ }
665
+ function compare_pojo(left, right) {
666
+ const left_keys = Object.getOwnPropertyNames(left);
667
+ const right_keys = Object.getOwnPropertyNames(right);
668
+ if (left_keys.length !== right_keys.length)
669
+ return false;
670
+ for (let key of left_keys) {
671
+ if (!$mol_compare_deep(left[key], Reflect.get(right, key)))
672
+ return false;
673
+ }
674
+ return true;
675
+ }
676
+ function compare_primitive(left, right) {
677
+ return Object.is(left[Symbol.toPrimitive]('default'), right[Symbol.toPrimitive]('default'));
678
+ }
679
+ })($ || ($ = {}));
680
+ //mol/compare/deep/deep.ts
681
+ ;
682
+ "use strict";
683
+ var $;
684
+ (function ($) {
685
+ function $mol_guid(length = 8, exists = () => false) {
686
+ for (;;) {
687
+ let id = Math.random().toString(36).substring(2, length + 2).toUpperCase();
688
+ if (exists(id))
689
+ continue;
690
+ return id;
691
+ }
692
+ }
693
+ $.$mol_guid = $mol_guid;
694
+ })($ || ($ = {}));
695
+ //mol/guid/guid.ts
696
+ ;
697
+ "use strict";
698
+ var $;
699
+ (function ($) {
700
+ $.$mol_key_store = new WeakMap();
701
+ function $mol_key(value) {
702
+ if (!value)
703
+ return JSON.stringify(value);
704
+ if (typeof value !== 'object' && typeof value !== 'function')
705
+ return JSON.stringify(value);
706
+ return JSON.stringify(value, (field, value) => {
707
+ if (!value)
708
+ return value;
709
+ if (typeof value !== 'object' && typeof value !== 'function')
710
+ return value;
711
+ if (Array.isArray(value))
712
+ return value;
713
+ const proto = Reflect.getPrototypeOf(value);
714
+ if (!proto)
715
+ return value;
716
+ if (Reflect.getPrototypeOf(proto) === null)
717
+ return value;
718
+ if ('toJSON' in value)
719
+ return value;
720
+ if (value instanceof RegExp)
721
+ return value.toString();
722
+ let key = $.$mol_key_store.get(value);
723
+ if (key)
724
+ return key;
725
+ key = $mol_guid();
726
+ $.$mol_key_store.set(value, key);
727
+ return key;
728
+ });
729
+ }
730
+ $.$mol_key = $mol_key;
731
+ })($ || ($ = {}));
732
+ //mol/key/key.ts
733
+ ;
734
+ "use strict";
735
+ var $;
736
736
  (function ($) {
737
737
  function $mol_wire_method(host, field, descr) {
738
738
  if (!descr)
@@ -742,8 +742,9 @@ var $;
742
742
  if (typeof sup[field] === 'function') {
743
743
  Object.defineProperty(orig, 'name', { value: sup[field].name });
744
744
  }
745
+ const temp = $mol_wire_fiber_temp.getter(orig);
745
746
  const value = function (...args) {
746
- const fiber = $mol_wire_fiber.temp(this ?? null, orig, ...args);
747
+ const fiber = temp(this ?? null, args);
747
748
  return fiber.sync();
748
749
  };
749
750
  Object.defineProperty(value, 'name', { value: orig.name + ' ' });
@@ -763,53 +764,6 @@ var $;
763
764
  class $mol_wire_fiber extends $mol_wire_pub_sub {
764
765
  task;
765
766
  host;
766
- static temp(host, task, ...args) {
767
- const existen = $mol_wire_auto()?.track_next();
768
- reuse: if (existen) {
769
- if (!(existen instanceof $mol_wire_fiber))
770
- break reuse;
771
- if (existen.host !== host)
772
- break reuse;
773
- if (existen.task !== task)
774
- break reuse;
775
- if (!$mol_compare_deep(existen.args, args))
776
- break reuse;
777
- return existen;
778
- }
779
- return new this(`${host?.[Symbol.toStringTag] ?? host}.${task.name}(#)`, task, host, ...args);
780
- }
781
- static persist(task, keys) {
782
- const field = task.name + '()';
783
- if (keys) {
784
- return function $mol_wire_fiber_persist(host, args) {
785
- let dict, key, fiber;
786
- key = `${host?.[Symbol.toStringTag] ?? host}.${task.name}(${args.map(v => $mol_key(v)).join(',')})`;
787
- dict = Object.getOwnPropertyDescriptor(host ?? task, field)?.value;
788
- if (dict) {
789
- const existen = dict.get(key);
790
- if (existen)
791
- return existen;
792
- }
793
- else {
794
- dict = (host ?? task)[field] = new Map();
795
- }
796
- fiber = new $mol_wire_fiber(key, task, host, ...args);
797
- dict.set(key, fiber);
798
- return fiber;
799
- };
800
- }
801
- else {
802
- return function $mol_wire_fiber_persist(host, args) {
803
- const existen = Object.getOwnPropertyDescriptor(host ?? task, field)?.value;
804
- if (existen)
805
- return existen;
806
- const key = `${host?.[Symbol.toStringTag] ?? host}.${field}`;
807
- const fiber = new $mol_wire_fiber(key, task, host, ...args);
808
- (host ?? task)[field] = fiber;
809
- return fiber;
810
- };
811
- }
812
- }
813
767
  static warm = true;
814
768
  static planning = [];
815
769
  static reaping = [];
@@ -854,8 +808,7 @@ var $;
854
808
  return this.cache;
855
809
  }
856
810
  persistent() {
857
- const id = this[Symbol.toStringTag];
858
- return id[id.length - 2] !== '#';
811
+ return this instanceof $mol_wire_fiber_persist;
859
812
  }
860
813
  field() {
861
814
  return this.task.name + '()';
@@ -875,7 +828,7 @@ var $;
875
828
  if ($mol_owning_check(this, prev)) {
876
829
  prev.destructor();
877
830
  }
878
- if (this.persistent()) {
831
+ if (this instanceof $mol_wire_fiber_persist) {
879
832
  if (this.pub_from === 0) {
880
833
  ;
881
834
  (this.host ?? this.task)[this.field()] = null;
@@ -919,7 +872,7 @@ var $;
919
872
  super.emit(quant);
920
873
  }
921
874
  commit() {
922
- if (this.persistent())
875
+ if (this instanceof $mol_wire_fiber_persist)
923
876
  return;
924
877
  super.commit();
925
878
  if (this.host instanceof $mol_wire_fiber) {
@@ -945,7 +898,17 @@ var $;
945
898
  const bu = this.track_on();
946
899
  let result;
947
900
  try {
948
- result = this.task.call(this.host, ...(this.pub_from ? this.slice(0, this.pub_from) : []));
901
+ switch (this.pub_from) {
902
+ case 0:
903
+ result = this.task.call(this.host);
904
+ break;
905
+ case 1:
906
+ result = this.task.call(this.host, this[0]);
907
+ break;
908
+ default:
909
+ result = this.task.call(this.host, ...this.slice(0, this.pub_from));
910
+ break;
911
+ }
949
912
  if (result instanceof Promise) {
950
913
  const put = (res) => {
951
914
  if (this.cache === result)
@@ -983,7 +946,7 @@ var $;
983
946
  prev.destructor();
984
947
  }
985
948
  this.cache = next;
986
- if (this.persistent() && $mol_owning_catch(this, next)) {
949
+ if (this instanceof $mol_wire_fiber_persist && $mol_owning_catch(this, next)) {
987
950
  try {
988
951
  next[Symbol.toStringTag] = this[Symbol.toStringTag];
989
952
  }
@@ -998,19 +961,19 @@ var $;
998
961
  this.cursor = $mol_wire_cursor.fresh;
999
962
  if (next instanceof Promise)
1000
963
  return next;
1001
- if (this.persistent()) {
964
+ if (this instanceof $mol_wire_fiber_persist) {
1002
965
  this.commit_pubs();
1003
966
  }
1004
967
  else {
1005
968
  if (this.sub_empty) {
1006
969
  this.commit();
1007
970
  }
971
+ else {
972
+ this.commit_pubs();
973
+ }
1008
974
  }
1009
975
  return next;
1010
976
  }
1011
- recall(...args) {
1012
- return this.task.call(this.host, ...args);
1013
- }
1014
977
  sync() {
1015
978
  if (!$mol_wire_fiber.warm) {
1016
979
  return this.result();
@@ -1040,10 +1003,68 @@ var $;
1040
1003
  }
1041
1004
  }
1042
1005
  }
1006
+ $.$mol_wire_fiber = $mol_wire_fiber;
1007
+ class $mol_wire_fiber_temp extends $mol_wire_fiber {
1008
+ static getter(task) {
1009
+ return function $mol_wire_fiber_temp_get(host, args) {
1010
+ const existen = $mol_wire_auto()?.track_next();
1011
+ reuse: if (existen) {
1012
+ if (!(existen instanceof $mol_wire_fiber_temp))
1013
+ break reuse;
1014
+ if (existen.host !== host)
1015
+ break reuse;
1016
+ if (existen.task !== task)
1017
+ break reuse;
1018
+ if (!$mol_compare_deep(existen.args, args))
1019
+ break reuse;
1020
+ return existen;
1021
+ }
1022
+ return new $mol_wire_fiber_temp(`${host?.[Symbol.toStringTag] ?? host}.${task.name}(#)`, task, host, ...args);
1023
+ };
1024
+ }
1025
+ }
1026
+ $.$mol_wire_fiber_temp = $mol_wire_fiber_temp;
1027
+ class $mol_wire_fiber_persist extends $mol_wire_fiber {
1028
+ static getter(task, keys) {
1029
+ const field = task.name + '()';
1030
+ if (keys) {
1031
+ return function $mol_wire_fiber_persist_get(host, args) {
1032
+ let dict, key, fiber;
1033
+ key = `${host?.[Symbol.toStringTag] ?? host}.${task.name}(${args.map(v => $mol_key(v)).join(',')})`;
1034
+ dict = Object.getOwnPropertyDescriptor(host ?? task, field)?.value;
1035
+ if (dict) {
1036
+ const existen = dict.get(key);
1037
+ if (existen)
1038
+ return existen;
1039
+ }
1040
+ else {
1041
+ dict = (host ?? task)[field] = new Map();
1042
+ }
1043
+ fiber = new $mol_wire_fiber_persist(key, task, host, ...args);
1044
+ dict.set(key, fiber);
1045
+ return fiber;
1046
+ };
1047
+ }
1048
+ else {
1049
+ return function $mol_wire_fiber_persist_get(host, args) {
1050
+ const existen = Object.getOwnPropertyDescriptor(host ?? task, field)?.value;
1051
+ if (existen)
1052
+ return existen;
1053
+ const key = `${host?.[Symbol.toStringTag] ?? host}.${field}`;
1054
+ const fiber = new $mol_wire_fiber_persist(key, task, host, ...args);
1055
+ (host ?? task)[field] = fiber;
1056
+ return fiber;
1057
+ };
1058
+ }
1059
+ }
1060
+ recall(...args) {
1061
+ return this.task.call(this.host, ...args);
1062
+ }
1063
+ }
1043
1064
  __decorate([
1044
1065
  $mol_wire_method
1045
- ], $mol_wire_fiber.prototype, "recall", null);
1046
- $.$mol_wire_fiber = $mol_wire_fiber;
1066
+ ], $mol_wire_fiber_persist.prototype, "recall", null);
1067
+ $.$mol_wire_fiber_persist = $mol_wire_fiber_persist;
1047
1068
  })($ || ($ = {}));
1048
1069
  //mol/wire/fiber/fiber.ts
1049
1070
  ;
@@ -1084,8 +1105,9 @@ var $;
1084
1105
  const val = obj[field];
1085
1106
  if (typeof val !== 'function')
1086
1107
  return val;
1108
+ const temp = $mol_wire_fiber_temp.getter(val);
1087
1109
  return function $mol_wire_sync(...args) {
1088
- const fiber = $mol_wire_fiber.temp(obj, val, ...args);
1110
+ const fiber = temp(obj, args);
1089
1111
  return fiber.sync();
1090
1112
  };
1091
1113
  }
@@ -1105,9 +1127,10 @@ var $;
1105
1127
  if (typeof val !== 'function')
1106
1128
  return val;
1107
1129
  let fiber;
1130
+ const temp = $mol_wire_fiber_temp.getter(val);
1108
1131
  return function $mol_wire_async(...args) {
1109
1132
  fiber?.destructor();
1110
- fiber = $mol_wire_fiber.temp(obj, val, ...args);
1133
+ fiber = temp(obj, args);
1111
1134
  return fiber.async();
1112
1135
  };
1113
1136
  }
@@ -1172,7 +1195,7 @@ var $;
1172
1195
  $.$mol_wire_mem = $mol_wire_mem;
1173
1196
  function $mol_wire_mem_func(keys) {
1174
1197
  return (func) => {
1175
- const persist = $mol_wire_fiber.persist(func, keys);
1198
+ const persist = $mol_wire_fiber_persist.getter(func, keys);
1176
1199
  const wrapper = function (...args) {
1177
1200
  let atom = persist(this, args.slice(0, keys));
1178
1201
  if (args.length <= keys || args[keys] === undefined)
@@ -1214,7 +1237,7 @@ var $;
1214
1237
  if (!descr)
1215
1238
  descr = Reflect.getOwnPropertyDescriptor(host, field);
1216
1239
  const _get = descr?.get || $mol_const(descr?.value);
1217
- const persist = $mol_wire_fiber.persist(_get, 0);
1240
+ const persist = $mol_wire_fiber_persist.getter(_get, 0);
1218
1241
  const _set = descr?.set || function (next) {
1219
1242
  persist(this, []).put(next);
1220
1243
  };
@@ -1225,8 +1248,9 @@ var $;
1225
1248
  function get() {
1226
1249
  return persist(this, []).sync();
1227
1250
  }
1251
+ const temp = $mol_wire_fiber_temp.getter(_set);
1228
1252
  function set(next) {
1229
- $mol_wire_fiber.temp(this, _set, next).sync();
1253
+ temp(this, [next]).sync();
1230
1254
  }
1231
1255
  Object.defineProperty(get, 'name', { value: _get.name + '$' });
1232
1256
  Object.defineProperty(set, 'name', { value: _set.name + '@' });
@@ -2125,15 +2149,6 @@ var $;
2125
2149
  ;
2126
2150
  "use strict";
2127
2151
  var $;
2128
- (function ($_1) {
2129
- $mol_test_mocks.push($ => {
2130
- $.$mol_after_timeout = $mol_after_mock_timeout;
2131
- });
2132
- })($ || ($ = {}));
2133
- //mol/after/timeout/timeout.test.ts
2134
- ;
2135
- "use strict";
2136
- var $;
2137
2152
  (function ($_1) {
2138
2153
  $mol_test({
2139
2154
  async 'Latest Calls Wins on Concurrency'($) {
@@ -2219,6 +2234,24 @@ var $;
2219
2234
  ;
2220
2235
  "use strict";
2221
2236
  var $;
2237
+ (function ($_1) {
2238
+ $mol_test_mocks.push($ => {
2239
+ $.$mol_after_timeout = $mol_after_mock_timeout;
2240
+ });
2241
+ })($ || ($ = {}));
2242
+ //mol/after/timeout/timeout.test.ts
2243
+ ;
2244
+ "use strict";
2245
+ var $;
2246
+ (function ($_1) {
2247
+ $mol_test_mocks.push($ => {
2248
+ $.$mol_after_frame = $mol_after_mock_commmon;
2249
+ });
2250
+ })($ || ($ = {}));
2251
+ //mol/after/frame/frame.test.ts
2252
+ ;
2253
+ "use strict";
2254
+ var $;
2222
2255
  (function ($) {
2223
2256
  $mol_test({
2224
2257
  'Primitives'() {
@@ -2274,15 +2307,6 @@ var $;
2274
2307
  ;
2275
2308
  "use strict";
2276
2309
  var $;
2277
- (function ($_1) {
2278
- $mol_test_mocks.push($ => {
2279
- $.$mol_after_frame = $mol_after_mock_commmon;
2280
- });
2281
- })($ || ($ = {}));
2282
- //mol/after/frame/frame.test.ts
2283
- ;
2284
- "use strict";
2285
- var $;
2286
2310
  (function ($) {
2287
2311
  $mol_test({
2288
2312
  'Sync execution'() {
@@ -2608,36 +2632,6 @@ var $;
2608
2632
  App.count(5);
2609
2633
  $mol_assert_like(App.res(), 6);
2610
2634
  },
2611
- async 'Toggle with async'($) {
2612
- class App extends $mol_object2 {
2613
- static $ = $;
2614
- static checked(next = false) {
2615
- $$.$mol_wait_timeout(0);
2616
- return next;
2617
- }
2618
- static toggle() {
2619
- const prev = this.checked();
2620
- $mol_assert_unique(this.checked(!prev), prev);
2621
- $mol_assert_equal(this.checked(), prev);
2622
- }
2623
- static res() {
2624
- return this.checked();
2625
- }
2626
- }
2627
- __decorate([
2628
- $mol_wire_mem(0)
2629
- ], App, "checked", null);
2630
- __decorate([
2631
- $mol_wire_method
2632
- ], App, "toggle", null);
2633
- __decorate([
2634
- $mol_wire_mem(0)
2635
- ], App, "res", null);
2636
- const app = $mol_wire_async(App);
2637
- $mol_assert_equal(await app.res(), false);
2638
- await app.toggle();
2639
- $mol_assert_equal(await app.res(), true);
2640
- },
2641
2635
  'Restore after error'($) {
2642
2636
  class App extends $mol_object2 {
2643
2637
  static get $() { return $; }