Track the list of currently rejected promises.
npm install currently-rejected> Track the list of currently rejected promises.
```
$ npm install --save currently-rejected
`js
const currentlyRejected = require('currently-rejected')(); // <- note the invocation
var fooError = new Error('foo');
var p = Promise.reject(new Error('foo'));
// on the next tick - unhandled rejected promise is added to the list:
currentlyRejected();
//=> [{promise: p, reason: fooError}]'
p.catch(() => {});
// on the next tick - handled promise is now removed from the list:
currentlyRejected();
//=> [];
`
Returns an array of objects with promise and reason` properties. The list is updated as unhandledRejections are published, and later handled.
MIT © James Talmage