1.0.0 • Published 4 years ago
promise-listen-catch v1.0.0
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(() => {
// ...
});