This library, and therefore got, can't be used in a program that uses Bluebird promises globally. This is because PCancelable amends its prototype tree to make it a subclass of Promise but never calls the base Promise constructor, making it a false subclass.
The following code demonstrates this:
import Bluebird from 'bluebird';
global.Promise = Bluebird;
import pcancelable from 'p-cancelable';
async function run() {
return await new pcancelable((resolve, reject) => {
resolve(true);
});
}
run().then(_ => console.log(_));
The code produces no output. It should print true
.
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too