File tree Expand file tree Collapse file tree
src/internal/observable/dom Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -55,6 +55,7 @@ export function fromFetch(input: string | Request, init?: RequestInit): Observab
5555 const controller = new AbortController ( ) ;
5656 const signal = controller . signal ;
5757 let outerSignalHandler : ( ) => void ;
58+ let abortable = true ;
5859 let unsubscribed = false ;
5960
6061 if ( init ) {
@@ -73,9 +74,11 @@ export function fromFetch(input: string | Request, init?: RequestInit): Observab
7374 }
7475
7576 fetch ( input , init ) . then ( response => {
77+ abortable = false ;
7678 subscriber . next ( response ) ;
7779 subscriber . complete ( ) ;
7880 } ) . catch ( err => {
81+ abortable = false ;
7982 if ( ! unsubscribed ) {
8083 // Only forward the error if it wasn't an abort.
8184 subscriber . error ( err ) ;
@@ -84,7 +87,9 @@ export function fromFetch(input: string | Request, init?: RequestInit): Observab
8487
8588 return ( ) => {
8689 unsubscribed = true ;
87- controller . abort ( ) ;
90+ if ( abortable ) {
91+ controller . abort ( ) ;
92+ }
8893 } ;
8994 } ) ;
9095}
You can’t perform that action at this time.
0 commit comments