promise-listen-catch
v1.0.0
Published
A library to listen the promise chain, and decide to reject or not.
Downloads
8
Readme
Promise Listen Catch
A library to listen the promise chain, and decide to reject or not.
Installation
yarn add promise-listen-catch
Usage
const promise = new PromiseListenCatch((resolve, reject) => {
setTimeout(() => {
if (promise.canReject()) {
reject('with catch');
} else {
resolve();
}
});
});
promise.then(() => {
// ...
});