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.js CHANGED
@@ -891,7 +891,8 @@ var $;
891
891
  class $mol_wire_task extends $mol_wire_fiber {
892
892
  static getter(task) {
893
893
  return function $mol_wire_task_get(host, args) {
894
- const existen = $mol_wire_auto()?.track_next();
894
+ const sub = $mol_wire_auto();
895
+ const existen = sub?.track_next();
895
896
  reuse: if (existen) {
896
897
  if (!(existen instanceof $mol_wire_task))
897
898
  break reuse;
@@ -903,6 +904,9 @@ var $;
903
904
  break reuse;
904
905
  return existen;
905
906
  }
907
+ if (existen && sub instanceof $mol_wire_task) {
908
+ $mol_fail(new Error(`$mol_wire_task detects nonidempotency\n${existen}`));
909
+ }
906
910
  return new $mol_wire_task(`${host?.[Symbol.toStringTag] ?? host}.${task.name}(#)`, task, host, args);
907
911
  };
908
912
  }