mol_wire_lib 1.0.439 → 1.0.440

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
@@ -1053,6 +1053,39 @@ var $;
1053
1053
  ;
1054
1054
  "use strict";
1055
1055
  var $;
1056
+ (function ($) {
1057
+ const cacthed = new WeakMap();
1058
+ function $mol_fail_catch(error) {
1059
+ if (typeof error !== 'object')
1060
+ return false;
1061
+ if (error instanceof Promise)
1062
+ $mol_fail_hidden(error);
1063
+ if (cacthed.get(error))
1064
+ return false;
1065
+ cacthed.set(error, true);
1066
+ return true;
1067
+ }
1068
+ $.$mol_fail_catch = $mol_fail_catch;
1069
+ })($ || ($ = {}));
1070
+ //mol/fail/catch/catch.ts
1071
+ ;
1072
+ "use strict";
1073
+ var $;
1074
+ (function ($) {
1075
+ function $mol_fail_log(error) {
1076
+ if (error instanceof Promise)
1077
+ return false;
1078
+ if (!$mol_fail_catch(error))
1079
+ return false;
1080
+ console.error(error);
1081
+ return true;
1082
+ }
1083
+ $.$mol_fail_log = $mol_fail_log;
1084
+ })($ || ($ = {}));
1085
+ //mol/fail/log/log.ts
1086
+ ;
1087
+ "use strict";
1088
+ var $;
1056
1089
  (function ($) {
1057
1090
  class $mol_wire_atom extends $mol_wire_fiber {
1058
1091
  static solo(host, task) {
@@ -1136,7 +1169,14 @@ var $;
1136
1169
  }
1137
1170
  put(next) {
1138
1171
  const prev = this.cache;
1139
- if (next !== prev) {
1172
+ update: if (next !== prev) {
1173
+ try {
1174
+ if ($mol_compare_deep(prev, next))
1175
+ break update;
1176
+ }
1177
+ catch (error) {
1178
+ $mol_fail_log(error);
1179
+ }
1140
1180
  if ($mol_owning_check(this, prev)) {
1141
1181
  prev.destructor();
1142
1182
  }
@@ -1149,11 +1189,8 @@ var $;
1149
1189
  Object.defineProperty(next, Symbol.toStringTag, { value: this[Symbol.toStringTag] });
1150
1190
  }
1151
1191
  }
1152
- if (this.sub_from < this.data.length) {
1153
- if (!$mol_compare_deep(prev, next)) {
1154
- this.emit();
1155
- }
1156
- }
1192
+ if (!this.sub_empty)
1193
+ this.emit();
1157
1194
  }
1158
1195
  this.cursor = $mol_wire_cursor.fresh;
1159
1196
  if (next instanceof Promise)
@@ -1798,39 +1835,6 @@ var $;
1798
1835
  ;
1799
1836
  "use strict";
1800
1837
  var $;
1801
- (function ($) {
1802
- const cacthed = new WeakMap();
1803
- function $mol_fail_catch(error) {
1804
- if (typeof error !== 'object')
1805
- return false;
1806
- if (error instanceof Promise)
1807
- $mol_fail_hidden(error);
1808
- if (cacthed.get(error))
1809
- return false;
1810
- cacthed.set(error, true);
1811
- return true;
1812
- }
1813
- $.$mol_fail_catch = $mol_fail_catch;
1814
- })($ || ($ = {}));
1815
- //mol/fail/catch/catch.ts
1816
- ;
1817
- "use strict";
1818
- var $;
1819
- (function ($) {
1820
- function $mol_fail_log(error) {
1821
- if (error instanceof Promise)
1822
- return false;
1823
- if (!$mol_fail_catch(error))
1824
- return false;
1825
- console.error(error);
1826
- return true;
1827
- }
1828
- $.$mol_fail_log = $mol_fail_log;
1829
- })($ || ($ = {}));
1830
- //mol/fail/log/log.ts
1831
- ;
1832
- "use strict";
1833
- var $;
1834
1838
  (function ($) {
1835
1839
  class $mol_wire_log extends $mol_object2 {
1836
1840
  static watch(task) {