Skip to content

Commit 4d23f87

Browse files
committed
fix(AjaxObservable): Fix for #1921 exposed AjaxObservable unsubscription error calling xhr.abort().
Possibly only an artifact of test utils, but after applying fix for #1921 started getting an error that xhr.abort() in AjaxObservable's unsubscribe call wasn't a function.
1 parent 8e7e4e3 commit 4d23f87

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/observable/dom/AjaxObservable.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ export class AjaxSubscriber<T> extends Subscriber<Event> {
361361

362362
unsubscribe() {
363363
const { done, xhr } = this;
364-
if (!done && xhr && xhr.readyState !== 4) {
364+
if (!done && xhr && xhr.readyState !== 4 && typeof xhr.abort === 'function') {
365365
xhr.abort();
366366
}
367367
super.unsubscribe();

0 commit comments

Comments
 (0)