$ npm install @isaacs/promise-trackerThis is a way to track the results of a promise, without
obscuring unhandledrejection events, or losing other added
properties that may exist on the promise being tracked.
It does not return the actual object, because it's impossible
to do that without modifying unhandledrejection behavior, while
also getting a view on the error being raised by the original
promise.
import { promiseTracker } from '@isaacs/promise-tracker'
promiseTracker(somePromise, (value) => {
// log the value or whatever
}, (error) => {
// report the error somewhere
})