Extending native JavaScript Promise with cancellation support
You can override the executor and can pass an onCancel function to it like following:
class ResponsePromise extends Promise {
  constructor(executor) {
    const onCancel =  (cb) =&gt; {
      //using nextTick because we cant use &quot;this&quot; before super()
      setTimeout(()=&gt; {
        this.cancelCb = cb;
      })
    }

    const oExecutor = (resolve, reject) =&gt; {
      executor(resolve, reject, onCancel);
    }

    super(oExecutor);
  }
  cancel() {
    if (this.cancelCb) {
      this.cancelCb();
    } else {
      console.warn('onCancel not provided');
    }
  }

I have explained this in http://w3.cafe/promise-with-progress-javascript/