alkemics/CancelablePromise

Add Symbol.toStringTag to CancelablePromise interface

Closed this issue · 2 comments

I tried the following (returning a cancelable promise but as the narrower Promise type:

function f(): Promise<number> {
  return cancelable(Promise.resolve(666))
}

But it fails because the TS default types includes:

interface Promise<T> {
    readonly [Symbol.toStringTag]: string;
}

Could this be added to this library for compatibility with the base promise type?

@sgronblo thank you for your report, I'll fix this asap.

cancelable-promise@4.3.1 has been published