mol_wire_lib 1.0.1508 → 1.0.1509

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.mjs CHANGED
@@ -176,11 +176,11 @@ var $;
176
176
  function $mol_dev_format_button(label, click) {
177
177
  return $mol_dev_format_auto({
178
178
  [$.$mol_dev_format_head]() {
179
- return $mol_dev_format_span({ color: 'cornflowerblue' }, label);
179
+ return $.$mol_dev_format_span({ color: 'cornflowerblue' }, label);
180
180
  },
181
181
  [$.$mol_dev_format_body]() {
182
182
  Promise.resolve().then(click);
183
- return $mol_dev_format_span({});
183
+ return $.$mol_dev_format_span({});
184
184
  }
185
185
  });
186
186
  }
@@ -202,7 +202,7 @@ var $;
202
202
  return $mol_dev_format_native(val);
203
203
  }
204
204
  if (val instanceof Error) {
205
- return $mol_dev_format_span({}, $mol_dev_format_native(val), ' ', $mol_dev_format_button('throw', () => $mol_fail_hidden(val)));
205
+ return $.$mol_dev_format_span({}, $mol_dev_format_native(val), ' ', $mol_dev_format_button('throw', () => $mol_fail_hidden(val)));
206
206
  }
207
207
  if (val instanceof Promise) {
208
208
  return $.$mol_dev_format_shade($mol_dev_format_native(val), ' ', val[Symbol.toStringTag] ?? '');
@@ -274,28 +274,23 @@ var $;
274
274
  ];
275
275
  }
276
276
  $.$mol_dev_format_element = $mol_dev_format_element;
277
- function $mol_dev_format_span(style, ...content) {
278
- return $mol_dev_format_element('span', {
279
- ...style,
280
- }, ...content);
281
- }
282
- $.$mol_dev_format_span = $mol_dev_format_span;
277
+ $.$mol_dev_format_span = $mol_dev_format_element.bind(null, 'span');
283
278
  $.$mol_dev_format_div = $mol_dev_format_element.bind(null, 'div');
284
279
  $.$mol_dev_format_ol = $mol_dev_format_element.bind(null, 'ol');
285
280
  $.$mol_dev_format_li = $mol_dev_format_element.bind(null, 'li');
286
281
  $.$mol_dev_format_table = $mol_dev_format_element.bind(null, 'table');
287
282
  $.$mol_dev_format_tr = $mol_dev_format_element.bind(null, 'tr');
288
283
  $.$mol_dev_format_td = $mol_dev_format_element.bind(null, 'td');
289
- $.$mol_dev_format_accent = $mol_dev_format_span.bind(null, {
284
+ $.$mol_dev_format_accent = $.$mol_dev_format_span.bind(null, {
290
285
  'color': 'magenta',
291
286
  });
292
- $.$mol_dev_format_strong = $mol_dev_format_span.bind(null, {
287
+ $.$mol_dev_format_strong = $.$mol_dev_format_span.bind(null, {
293
288
  'font-weight': 'bold',
294
289
  });
295
- $.$mol_dev_format_string = $mol_dev_format_span.bind(null, {
290
+ $.$mol_dev_format_string = $.$mol_dev_format_span.bind(null, {
296
291
  'color': 'green',
297
292
  });
298
- $.$mol_dev_format_shade = $mol_dev_format_span.bind(null, {
293
+ $.$mol_dev_format_shade = $.$mol_dev_format_span.bind(null, {
299
294
  'color': 'gray',
300
295
  });
301
296
  $.$mol_dev_format_indent = $.$mol_dev_format_div.bind(null, {
@@ -1184,15 +1179,22 @@ var $;
1184
1179
  return function $mol_wire_task_get(host, args) {
1185
1180
  const sub = $mol_wire_auto();
1186
1181
  const existen = sub?.track_next();
1182
+ let cause = '';
1187
1183
  reuse: if (existen) {
1188
1184
  if (!existen.temp)
1189
1185
  break reuse;
1190
- if (existen.host !== host)
1186
+ if (existen.task !== task) {
1187
+ cause = 'task';
1191
1188
  break reuse;
1192
- if (existen.task !== task)
1189
+ }
1190
+ if (existen.host !== host) {
1191
+ cause = 'host';
1193
1192
  break reuse;
1194
- if (!$mol_compare_deep(existen.args, args))
1193
+ }
1194
+ if (!$mol_compare_deep(existen.args, args)) {
1195
+ cause = 'args';
1195
1196
  break reuse;
1197
+ }
1196
1198
  return existen;
1197
1199
  }
1198
1200
  const key = (host?.[Symbol.toStringTag] ?? host) + ('.' + task.name + '<#>');
@@ -1200,11 +1202,11 @@ var $;
1200
1202
  if (existen?.temp) {
1201
1203
  $$.$mol_log3_warn({
1202
1204
  place: '$mol_wire_task',
1203
- message: `Non idempotency`,
1205
+ message: `Different ${cause} on restart`,
1204
1206
  sub,
1205
- pubs: [...sub?.pub_list ?? [], existen],
1207
+ prev: existen,
1206
1208
  next,
1207
- hint: 'Ignore it',
1209
+ hint: 'Maybe required additional memoization',
1208
1210
  });
1209
1211
  }
1210
1212
  return next;