mol_wire_dom 0.0.1490 → 0.0.1492

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, {
@@ -1273,15 +1268,22 @@ var $;
1273
1268
  return function $mol_wire_task_get(host, args) {
1274
1269
  const sub = $mol_wire_auto();
1275
1270
  const existen = sub?.track_next();
1271
+ let cause = '';
1276
1272
  reuse: if (existen) {
1277
1273
  if (!existen.temp)
1278
1274
  break reuse;
1279
- if (existen.host !== host)
1275
+ if (existen.task !== task) {
1276
+ cause = 'task';
1280
1277
  break reuse;
1281
- if (existen.task !== task)
1278
+ }
1279
+ if (existen.host !== host) {
1280
+ cause = 'host';
1282
1281
  break reuse;
1283
- if (!$mol_compare_deep(existen.args, args))
1282
+ }
1283
+ if (!$mol_compare_deep(existen.args, args)) {
1284
+ cause = 'args';
1284
1285
  break reuse;
1286
+ }
1285
1287
  return existen;
1286
1288
  }
1287
1289
  const key = (host?.[Symbol.toStringTag] ?? host) + ('.' + task.name + '<#>');
@@ -1289,11 +1291,11 @@ var $;
1289
1291
  if (existen?.temp) {
1290
1292
  $$.$mol_log3_warn({
1291
1293
  place: '$mol_wire_task',
1292
- message: `Non idempotency`,
1294
+ message: `Different ${cause} on restart`,
1293
1295
  sub,
1294
- pubs: [...sub?.pub_list ?? [], existen],
1296
+ prev: existen,
1295
1297
  next,
1296
- hint: 'Ignore it',
1298
+ hint: 'Maybe required additional memoization',
1297
1299
  });
1298
1300
  }
1299
1301
  return next;