mol_mutable 0.0.995 → 0.0.997

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
@@ -751,11 +751,11 @@ var $;
751
751
  function $mol_dev_format_button(label, click) {
752
752
  return $mol_dev_format_auto({
753
753
  [$.$mol_dev_format_head]() {
754
- return $mol_dev_format_span({ color: 'cornflowerblue' }, label);
754
+ return $.$mol_dev_format_span({ color: 'cornflowerblue' }, label);
755
755
  },
756
756
  [$.$mol_dev_format_body]() {
757
757
  Promise.resolve().then(click);
758
- return $mol_dev_format_span({});
758
+ return $.$mol_dev_format_span({});
759
759
  }
760
760
  });
761
761
  }
@@ -777,7 +777,7 @@ var $;
777
777
  return $mol_dev_format_native(val);
778
778
  }
779
779
  if (val instanceof Error) {
780
- return $mol_dev_format_span({}, $mol_dev_format_native(val), ' ', $mol_dev_format_button('throw', () => $mol_fail_hidden(val)));
780
+ return $.$mol_dev_format_span({}, $mol_dev_format_native(val), ' ', $mol_dev_format_button('throw', () => $mol_fail_hidden(val)));
781
781
  }
782
782
  if (val instanceof Promise) {
783
783
  return $.$mol_dev_format_shade($mol_dev_format_native(val), ' ', val[Symbol.toStringTag] ?? '');
@@ -849,28 +849,23 @@ var $;
849
849
  ];
850
850
  }
851
851
  $.$mol_dev_format_element = $mol_dev_format_element;
852
- function $mol_dev_format_span(style, ...content) {
853
- return $mol_dev_format_element('span', {
854
- ...style,
855
- }, ...content);
856
- }
857
- $.$mol_dev_format_span = $mol_dev_format_span;
852
+ $.$mol_dev_format_span = $mol_dev_format_element.bind(null, 'span');
858
853
  $.$mol_dev_format_div = $mol_dev_format_element.bind(null, 'div');
859
854
  $.$mol_dev_format_ol = $mol_dev_format_element.bind(null, 'ol');
860
855
  $.$mol_dev_format_li = $mol_dev_format_element.bind(null, 'li');
861
856
  $.$mol_dev_format_table = $mol_dev_format_element.bind(null, 'table');
862
857
  $.$mol_dev_format_tr = $mol_dev_format_element.bind(null, 'tr');
863
858
  $.$mol_dev_format_td = $mol_dev_format_element.bind(null, 'td');
864
- $.$mol_dev_format_accent = $mol_dev_format_span.bind(null, {
859
+ $.$mol_dev_format_accent = $.$mol_dev_format_span.bind(null, {
865
860
  'color': 'magenta',
866
861
  });
867
- $.$mol_dev_format_strong = $mol_dev_format_span.bind(null, {
862
+ $.$mol_dev_format_strong = $.$mol_dev_format_span.bind(null, {
868
863
  'font-weight': 'bold',
869
864
  });
870
- $.$mol_dev_format_string = $mol_dev_format_span.bind(null, {
865
+ $.$mol_dev_format_string = $.$mol_dev_format_span.bind(null, {
871
866
  'color': 'green',
872
867
  });
873
- $.$mol_dev_format_shade = $mol_dev_format_span.bind(null, {
868
+ $.$mol_dev_format_shade = $.$mol_dev_format_span.bind(null, {
874
869
  'color': 'gray',
875
870
  });
876
871
  $.$mol_dev_format_indent = $.$mol_dev_format_div.bind(null, {
@@ -1662,15 +1657,22 @@ var $;
1662
1657
  return function $mol_wire_task_get(host, args) {
1663
1658
  const sub = $mol_wire_auto();
1664
1659
  const existen = sub?.track_next();
1660
+ let cause = '';
1665
1661
  reuse: if (existen) {
1666
1662
  if (!existen.temp)
1667
1663
  break reuse;
1668
- if (existen.host !== host)
1664
+ if (existen.task !== task) {
1665
+ cause = 'task';
1669
1666
  break reuse;
1670
- if (existen.task !== task)
1667
+ }
1668
+ if (existen.host !== host) {
1669
+ cause = 'host';
1671
1670
  break reuse;
1672
- if (!$mol_compare_deep(existen.args, args))
1671
+ }
1672
+ if (!$mol_compare_deep(existen.args, args)) {
1673
+ cause = 'args';
1673
1674
  break reuse;
1675
+ }
1674
1676
  return existen;
1675
1677
  }
1676
1678
  const key = (host?.[Symbol.toStringTag] ?? host) + ('.' + task.name + '<#>');
@@ -1678,11 +1680,11 @@ var $;
1678
1680
  if (existen?.temp) {
1679
1681
  $$.$mol_log3_warn({
1680
1682
  place: '$mol_wire_task',
1681
- message: `Non idempotency`,
1683
+ message: `Different ${cause} on restart`,
1682
1684
  sub,
1683
- pubs: [...sub?.pub_list ?? [], existen],
1685
+ prev: existen,
1684
1686
  next,
1685
- hint: 'Ignore it',
1687
+ hint: 'Maybe required additional memoization',
1686
1688
  });
1687
1689
  }
1688
1690
  return next;