JSPM

react-native-promise-rejection-utils

0.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 19461
  • Score
    100M100P100Q151926F
  • License MIT

Utils for global tracking of unhandled promise rejections

Package Exports

  • react-native-promise-rejection-utils

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-native-promise-rejection-utils) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

react-native-promise-rejection-utils

npm version Dependency Status devDependencies Status npm

Utils for global tracking of unhandled promise rejections.

Installation

$ npm i react-native-promise-rejection-utils

Usage

import {
  getUnhandledPromiseRejectionTracker,
  setUnhandledPromiseRejectionTracker,
} from 'react-native-promise-rejection-utils'

const prevTracker = getUnhandledPromiseRejectionTracker()

setUnhandledPromiseRejectionTracker((id, error) => {
  console.warn('Unhandled promise rejection!', id, error)

  if (prevTracker !== undefined) {
    prevTracker(id, error)
  }
})