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/node.js CHANGED
@@ -1047,6 +1047,39 @@ var $;
1047
1047
  ;
1048
1048
  "use strict";
1049
1049
  var $;
1050
+ (function ($) {
1051
+ const cacthed = new WeakMap();
1052
+ function $mol_fail_catch(error) {
1053
+ if (typeof error !== 'object')
1054
+ return false;
1055
+ if (error instanceof Promise)
1056
+ $mol_fail_hidden(error);
1057
+ if (cacthed.get(error))
1058
+ return false;
1059
+ cacthed.set(error, true);
1060
+ return true;
1061
+ }
1062
+ $.$mol_fail_catch = $mol_fail_catch;
1063
+ })($ || ($ = {}));
1064
+ //mol/fail/catch/catch.ts
1065
+ ;
1066
+ "use strict";
1067
+ var $;
1068
+ (function ($) {
1069
+ function $mol_fail_log(error) {
1070
+ if (error instanceof Promise)
1071
+ return false;
1072
+ if (!$mol_fail_catch(error))
1073
+ return false;
1074
+ console.error(error);
1075
+ return true;
1076
+ }
1077
+ $.$mol_fail_log = $mol_fail_log;
1078
+ })($ || ($ = {}));
1079
+ //mol/fail/log/log.ts
1080
+ ;
1081
+ "use strict";
1082
+ var $;
1050
1083
  (function ($) {
1051
1084
  class $mol_wire_atom extends $mol_wire_fiber {
1052
1085
  static solo(host, task) {
@@ -1130,7 +1163,14 @@ var $;
1130
1163
  }
1131
1164
  put(next) {
1132
1165
  const prev = this.cache;
1133
- if (next !== prev) {
1166
+ update: if (next !== prev) {
1167
+ try {
1168
+ if ($mol_compare_deep(prev, next))
1169
+ break update;
1170
+ }
1171
+ catch (error) {
1172
+ $mol_fail_log(error);
1173
+ }
1134
1174
  if ($mol_owning_check(this, prev)) {
1135
1175
  prev.destructor();
1136
1176
  }
@@ -1143,11 +1183,8 @@ var $;
1143
1183
  Object.defineProperty(next, Symbol.toStringTag, { value: this[Symbol.toStringTag] });
1144
1184
  }
1145
1185
  }
1146
- if (this.sub_from < this.data.length) {
1147
- if (!$mol_compare_deep(prev, next)) {
1148
- this.emit();
1149
- }
1150
- }
1186
+ if (!this.sub_empty)
1187
+ this.emit();
1151
1188
  }
1152
1189
  this.cursor = $mol_wire_cursor.fresh;
1153
1190
  if (next instanceof Promise)
@@ -2139,39 +2176,6 @@ var $;
2139
2176
  ;
2140
2177
  "use strict";
2141
2178
  var $;
2142
- (function ($) {
2143
- const cacthed = new WeakMap();
2144
- function $mol_fail_catch(error) {
2145
- if (typeof error !== 'object')
2146
- return false;
2147
- if (error instanceof Promise)
2148
- $mol_fail_hidden(error);
2149
- if (cacthed.get(error))
2150
- return false;
2151
- cacthed.set(error, true);
2152
- return true;
2153
- }
2154
- $.$mol_fail_catch = $mol_fail_catch;
2155
- })($ || ($ = {}));
2156
- //mol/fail/catch/catch.ts
2157
- ;
2158
- "use strict";
2159
- var $;
2160
- (function ($) {
2161
- function $mol_fail_log(error) {
2162
- if (error instanceof Promise)
2163
- return false;
2164
- if (!$mol_fail_catch(error))
2165
- return false;
2166
- console.error(error);
2167
- return true;
2168
- }
2169
- $.$mol_fail_log = $mol_fail_log;
2170
- })($ || ($ = {}));
2171
- //mol/fail/log/log.ts
2172
- ;
2173
- "use strict";
2174
- var $;
2175
2179
  (function ($) {
2176
2180
  class $mol_wire_log extends $mol_object2 {
2177
2181
  static watch(task) {