Skip to content

Commit

Permalink
Propagate abort to "child" promises
Browse files Browse the repository at this point in the history
  • Loading branch information
mjackson committed Aug 18, 2014
1 parent 6267ce0 commit d55876a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions modules/utils/AbortablePromise.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,13 @@ function AbortablePromise(resolver) {

var abortHandler, onAbort;
var promise = new Promise(function (resolve, reject) {
resolver(function () {
abortHandler = null;
resolver(function (child) {
if (child && typeof child.abort === 'function') {
abortHandler = child.abort;
} else {
abortHandler = null;
}

resolve.apply(this, arguments);
}, function () {
abortHandler = null;
Expand Down

0 comments on commit d55876a

Please sign in to comment.