Skip to content

Commit f4c6885

Browse files
committed
update
1 parent f4abfa0 commit f4c6885

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/_request.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ export const StubRequest = /* @__PURE__ */ (() => {
22
class StubRequest implements Omit<Request, "fetcher" | "cf"> {
33
url: string;
44

5-
_signal?: AbortSignal;
5+
_abortController?: AbortController;
66
_headers?: Headers;
77
_init?: RequestInit;
88

@@ -29,7 +29,10 @@ export const StubRequest = /* @__PURE__ */ (() => {
2929
}
3030

3131
get signal() {
32-
return (this._signal ??= new AbortController().signal);
32+
if (!this._abortController) {
33+
this._abortController = new AbortController();
34+
}
35+
return this._abortController.signal;
3336
}
3437

3538
get cache() {
@@ -69,7 +72,7 @@ export const StubRequest = /* @__PURE__ */ (() => {
6972
}
7073

7174
get body() {
72-
return null; // eslint-disable-line unicorn/no-null
75+
return null;
7376
}
7477

7578
get bodyUsed() {

0 commit comments

Comments
 (0)