@jsenv/navi 0.13.4 → 0.14.0

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.
@@ -4574,16 +4574,17 @@ const useStateArray = (
4574
4574
  const createRequestCanceller = (reason = "Request superseded") => {
4575
4575
  let previousAbortController;
4576
4576
  return () => {
4577
- previousAbortController?.abort(reason);
4577
+ if (previousAbortController) {
4578
+ const abortError = new DOMException(reason, "AbortError");
4579
+ abortError.isHandled = true;
4580
+ previousAbortController.abort(abortError);
4581
+ }
4578
4582
  previousAbortController = new AbortController();
4579
4583
  return previousAbortController.signal;
4580
4584
  };
4581
4585
  };
4582
4586
  window.addEventListener("unhandledrejection", (event) => {
4583
- if (
4584
- event.reason?.name === "AbortError" &&
4585
- event.reason?.message === "Request superseded"
4586
- ) {
4587
+ if (event.reason?.isHandled) {
4587
4588
  event.preventDefault(); // 💥 empêche les "uncaught rejection" devtools pour nos cancellations
4588
4589
  }
4589
4590
  });