We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5c07dc3 commit 8c15797Copy full SHA for 8c15797
1 file changed
src/client.ts
@@ -548,9 +548,10 @@ export class SentDm {
548
controller: AbortController,
549
): Promise<Response> {
550
const { signal, method, ...options } = init || {};
551
- if (signal) signal.addEventListener('abort', () => controller.abort());
+ const abort = controller.abort.bind(controller);
552
+ if (signal) signal.addEventListener('abort', abort, { once: true });
553
- const timeout = setTimeout(() => controller.abort(), ms);
554
+ const timeout = setTimeout(abort, ms);
555
556
const isReadableBody =
557
((globalThis as any).ReadableStream && options.body instanceof (globalThis as any).ReadableStream) ||
0 commit comments