File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change 1
1
/**
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
+ */
4
4
export function abortSignalAny (
5
5
signals : AbortSignal [ ] ,
6
6
) : AbortSignal {
7
7
if ( typeof AbortSignal . any === 'function' ) {
8
8
return AbortSignal . any ( signals ) ;
9
9
}
10
10
11
- const ac = new AbortController ( ) ;
11
+ const controller = new AbortController ( ) ;
12
12
13
13
for ( const signal of signals ) {
14
14
if ( signal . aborted ) {
15
- ac . abort ( ) ;
15
+ controller . abort ( ) ;
16
16
} else {
17
17
signal . addEventListener ( 'abort' , ( ) => {
18
- ac . abort ( ) ;
18
+ controller . abort ( ) ;
19
19
} , { once : true } ) ;
20
20
}
21
21
}
22
22
23
- return ac . signal ;
23
+ return controller . signal ;
24
24
}
You can’t perform that action at this time.
0 commit comments