Skip to content

Commit

Permalink
Merge pull request #17 from alk-sdavid/security
Browse files Browse the repository at this point in the history
security: upgrade dependencies
  • Loading branch information
sebdvd authored Jul 17, 2019
2 parents 18be51a + b5e3765 commit d603780
Show file tree
Hide file tree
Showing 8 changed files with 6,696 additions and 1,554 deletions.
2 changes: 2 additions & 0 deletions .prettierrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
singleQuote: true
trailingComma: es5
39 changes: 21 additions & 18 deletions CancelablePromise.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,25 +38,28 @@ export default class CancelablePromise {

then(success, error) {
const p = new CancelablePromise((resolve, reject) => {
this._promise.then((r) => {
if (this._canceled) {
p.cancel();
this._promise.then(
r => {
if (this._canceled) {
p.cancel();
}
if (success && !this._canceled) {
handleCallback(resolve, reject, success, r);
} else {
resolve(r);
}
},
r => {
if (this._canceled) {
p.cancel();
}
if (error && !this._canceled) {
handleCallback(resolve, reject, error, r);
} else {
reject(r);
}
}
if (success && !this._canceled) {
handleCallback(resolve, reject, success, r);
} else {
resolve(r);
}
}, (r) => {
if (this._canceled) {
p.cancel();
}
if (error && !this._canceled) {
handleCallback(resolve, reject, error, r);
} else {
reject(r);
}
});
);
});
return p;
}
Expand Down
Loading

0 comments on commit d603780

Please sign in to comment.