Skip to content

Commit a8253aa

Browse files
authored
Update abort.ts
1 parent 4a19426 commit a8253aa

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

source/utils/abort.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
/**
2-
* A ponyfill for [`AbortSignal.any`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal/any_static).
3-
*/
2+
A ponyfill for [`AbortSignal.any`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal/any_static).
3+
*/
44
export function abortSignalAny(
55
signals: AbortSignal[],
66
): AbortSignal {
77
if (typeof AbortSignal.any === 'function') {
88
return AbortSignal.any(signals);
99
}
1010

11-
const ac = new AbortController();
11+
const controller = new AbortController();
1212

1313
for (const signal of signals) {
1414
if (signal.aborted) {
15-
ac.abort();
15+
controller.abort();
1616
} else {
1717
signal.addEventListener('abort', () => {
18-
ac.abort();
18+
controller.abort();
1919
}, {once: true});
2020
}
2121
}
2222

23-
return ac.signal;
23+
return controller.signal;
2424
}

0 commit comments

Comments
 (0)