Skip to content

Commit

Permalink
fix(AjaxObservable): Fix for #1921 exposed AjaxObservable unsubscript…
Browse files Browse the repository at this point in the history
…ion 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.
  • Loading branch information
trxcllnt committed Sep 11, 2016
1 parent 8e7e4e3 commit 4d23f87
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/observable/dom/AjaxObservable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ export class AjaxSubscriber<T> extends Subscriber<Event> {

unsubscribe() {
const { done, xhr } = this;
if (!done && xhr && xhr.readyState !== 4) {
if (!done && xhr && xhr.readyState !== 4 && typeof xhr.abort === 'function') {
xhr.abort();
}
super.unsubscribe();
Expand Down

0 comments on commit 4d23f87

Please sign in to comment.