npm stats
  • Search
  • About
  • Repo
  • Sponsor
  • more
    • Search
    • About
    • Repo
    • Sponsor

Made by Antonio Ramirez

@isaacs/promise-tracker

1.0.0

@isaacs

npmHomeRepoSnykSocket
Downloads:53
$ npm install @isaacs/promise-tracker
DailyWeeklyMonthlyYearly

@isaacs/promise-tracker

This 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.

USAGE

import { promiseTracker } from '@isaacs/promise-tracker'

promiseTracker(somePromise, (value) => {
  // log the value or whatever
}, (error) => {
  // report the error somewhere
})