You cannot cancel a promise, but you can associate your promises with then and reject at any point.
new Promise((resolve, reject) => { // step 1 }) .then((result) => { if (!result) { // Reject the promise chain throw 'cancel'; } else { return ... // step 2 } }) .catch(err => { // cancelled });
source share