mol_key 0.0.1335 → 0.0.1336

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
@@ -255,11 +255,11 @@ var $;
255
255
  function $mol_dev_format_button(label, click) {
256
256
  return $mol_dev_format_auto({
257
257
  [$.$mol_dev_format_head]() {
258
- return $mol_dev_format_span({ color: 'cornflowerblue' }, label);
258
+ return $.$mol_dev_format_span({ color: 'cornflowerblue' }, label);
259
259
  },
260
260
  [$.$mol_dev_format_body]() {
261
261
  Promise.resolve().then(click);
262
- return $mol_dev_format_span({});
262
+ return $.$mol_dev_format_span({});
263
263
  }
264
264
  });
265
265
  }
@@ -281,7 +281,7 @@ var $;
281
281
  return $mol_dev_format_native(val);
282
282
  }
283
283
  if (val instanceof Error) {
284
- return $mol_dev_format_span({}, $mol_dev_format_native(val), ' ', $mol_dev_format_button('throw', () => $mol_fail_hidden(val)));
284
+ return $.$mol_dev_format_span({}, $mol_dev_format_native(val), ' ', $mol_dev_format_button('throw', () => $mol_fail_hidden(val)));
285
285
  }
286
286
  if (val instanceof Promise) {
287
287
  return $.$mol_dev_format_shade($mol_dev_format_native(val), ' ', val[Symbol.toStringTag] ?? '');
@@ -353,28 +353,23 @@ var $;
353
353
  ];
354
354
  }
355
355
  $.$mol_dev_format_element = $mol_dev_format_element;
356
- function $mol_dev_format_span(style, ...content) {
357
- return $mol_dev_format_element('span', {
358
- ...style,
359
- }, ...content);
360
- }
361
- $.$mol_dev_format_span = $mol_dev_format_span;
356
+ $.$mol_dev_format_span = $mol_dev_format_element.bind(null, 'span');
362
357
  $.$mol_dev_format_div = $mol_dev_format_element.bind(null, 'div');
363
358
  $.$mol_dev_format_ol = $mol_dev_format_element.bind(null, 'ol');
364
359
  $.$mol_dev_format_li = $mol_dev_format_element.bind(null, 'li');
365
360
  $.$mol_dev_format_table = $mol_dev_format_element.bind(null, 'table');
366
361
  $.$mol_dev_format_tr = $mol_dev_format_element.bind(null, 'tr');
367
362
  $.$mol_dev_format_td = $mol_dev_format_element.bind(null, 'td');
368
- $.$mol_dev_format_accent = $mol_dev_format_span.bind(null, {
363
+ $.$mol_dev_format_accent = $.$mol_dev_format_span.bind(null, {
369
364
  'color': 'magenta',
370
365
  });
371
- $.$mol_dev_format_strong = $mol_dev_format_span.bind(null, {
366
+ $.$mol_dev_format_strong = $.$mol_dev_format_span.bind(null, {
372
367
  'font-weight': 'bold',
373
368
  });
374
- $.$mol_dev_format_string = $mol_dev_format_span.bind(null, {
369
+ $.$mol_dev_format_string = $.$mol_dev_format_span.bind(null, {
375
370
  'color': 'green',
376
371
  });
377
- $.$mol_dev_format_shade = $mol_dev_format_span.bind(null, {
372
+ $.$mol_dev_format_shade = $.$mol_dev_format_span.bind(null, {
378
373
  'color': 'gray',
379
374
  });
380
375
  $.$mol_dev_format_indent = $.$mol_dev_format_div.bind(null, {
@@ -2568,15 +2563,22 @@ var $;
2568
2563
  return function $mol_wire_task_get(host, args) {
2569
2564
  const sub = $mol_wire_auto();
2570
2565
  const existen = sub?.track_next();
2566
+ let cause = '';
2571
2567
  reuse: if (existen) {
2572
2568
  if (!existen.temp)
2573
2569
  break reuse;
2574
- if (existen.host !== host)
2570
+ if (existen.task !== task) {
2571
+ cause = 'task';
2575
2572
  break reuse;
2576
- if (existen.task !== task)
2573
+ }
2574
+ if (existen.host !== host) {
2575
+ cause = 'host';
2577
2576
  break reuse;
2578
- if (!$mol_compare_deep(existen.args, args))
2577
+ }
2578
+ if (!$mol_compare_deep(existen.args, args)) {
2579
+ cause = 'args';
2579
2580
  break reuse;
2581
+ }
2580
2582
  return existen;
2581
2583
  }
2582
2584
  const key = (host?.[Symbol.toStringTag] ?? host) + ('.' + task.name + '<#>');
@@ -2584,11 +2586,11 @@ var $;
2584
2586
  if (existen?.temp) {
2585
2587
  $$.$mol_log3_warn({
2586
2588
  place: '$mol_wire_task',
2587
- message: `Non idempotency`,
2589
+ message: `Different ${cause} on restart`,
2588
2590
  sub,
2589
- pubs: [...sub?.pub_list ?? [], existen],
2591
+ prev: existen,
2590
2592
  next,
2591
- hint: 'Ignore it',
2593
+ hint: 'Maybe required additional memoization',
2592
2594
  });
2593
2595
  }
2594
2596
  return next;