Skip to content

Commit db7ece2

Browse files
authored
Merge pull request #113 from doolse/fixcanceller
Return the correctly formed canceller (fixes #112)
2 parents 2e9a918 + 3ae93ea commit db7ece2

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

src/Network/HTTP/Affjax.js

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,13 @@ exports._ajax = function () {
7474
xhr.withCredentials = options.withCredentials;
7575
xhr.send(options.content);
7676

77-
return function (/* error */) {
78-
return function (cancelErrback, cancelCallback) {
79-
try {
80-
xhr.abort();
81-
} catch (e) {
82-
return cancelErrback(e);
83-
}
84-
return cancelCallback();
85-
};
77+
return function (error, cancelErrback, cancelCallback) {
78+
try {
79+
xhr.abort();
80+
} catch (e) {
81+
return cancelErrback(e);
82+
}
83+
return cancelCallback();
8684
};
8785
};
8886
};

0 commit comments

Comments
 (0)