File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -95,15 +95,16 @@ export class BaseHttpLink extends ApolloLink {
9595 controller = undefined ;
9696 } ;
9797 if ( options . signal ) {
98+ const externalSignal = options . signal ;
9899 // in an ideal world we could use `AbortSignal.any` here, but
99100 // React Native uses https://github.com/mysticatea/abort-controller as
100101 // a polyfill for `AbortController`, and it does not support `AbortSignal.any`.
101102 const abort = controller . abort . bind ( controller ) ;
102- options . signal . addEventListener ( "abort" , abort , { once : true } ) ;
103+ externalSignal . addEventListener ( "abort" , abort , { once : true } ) ;
103104 cleanupController = ( ) => {
104105 controller = undefined ;
105106 // on cleanup, we need to stop listening to `options.signal` to avoid memory leaks
106- options . signal . removeEventListener ( "abort" , abort ) ;
107+ externalSignal . removeEventListener ( "abort" , abort ) ;
107108 cleanupController = noop ;
108109 } ;
109110 // react native also does not support the addEventListener `signal` option
You can’t perform that action at this time.
0 commit comments