mol_wire_lib 1.0.243 → 1.0.246

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
@@ -883,7 +883,8 @@ var $;
883
883
  class $mol_wire_task extends $mol_wire_fiber {
884
884
  static getter(task) {
885
885
  return function $mol_wire_task_get(host, args) {
886
- const existen = $mol_wire_auto()?.track_next();
886
+ const sub = $mol_wire_auto();
887
+ const existen = sub?.track_next();
887
888
  reuse: if (existen) {
888
889
  if (!(existen instanceof $mol_wire_task))
889
890
  break reuse;
@@ -895,6 +896,9 @@ var $;
895
896
  break reuse;
896
897
  return existen;
897
898
  }
899
+ if (existen && sub instanceof $mol_wire_task) {
900
+ $mol_fail(new Error(`$mol_wire_task detects nonidempotency\n${existen}`));
901
+ }
898
902
  return new $mol_wire_task(`${host?.[Symbol.toStringTag] ?? host}.${task.name}(#)`, task, host, args);
899
903
  };
900
904
  }