File tree 1 file changed +6
-1
lines changed
src/internal/observable/dom
1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,7 @@ export function fromFetch(input: string | Request, init?: RequestInit): Observab
55
55
const controller = new AbortController ( ) ;
56
56
const signal = controller . signal ;
57
57
let outerSignalHandler : ( ) => void ;
58
+ let abortable = true ;
58
59
let unsubscribed = false ;
59
60
60
61
if ( init ) {
@@ -73,9 +74,11 @@ export function fromFetch(input: string | Request, init?: RequestInit): Observab
73
74
}
74
75
75
76
fetch ( input , init ) . then ( response => {
77
+ abortable = false ;
76
78
subscriber . next ( response ) ;
77
79
subscriber . complete ( ) ;
78
80
} ) . catch ( err => {
81
+ abortable = false ;
79
82
if ( ! unsubscribed ) {
80
83
// Only forward the error if it wasn't an abort.
81
84
subscriber . error ( err ) ;
@@ -84,7 +87,9 @@ export function fromFetch(input: string | Request, init?: RequestInit): Observab
84
87
85
88
return ( ) => {
86
89
unsubscribed = true ;
87
- controller . abort ( ) ;
90
+ if ( abortable ) {
91
+ controller . abort ( ) ;
92
+ }
88
93
} ;
89
94
} ) ;
90
95
}
You can’t perform that action at this time.
0 commit comments