JSPM

@playerony/try-catch-wrapper

1.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q55217F
  • License MIT

Functional try-catch wrapper.

Package Exports

  • @playerony/try-catch-wrapper

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 (@playerony/try-catch-wrapper) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

try catch wrapper

Lint Test Build Prettier Typecheck Commitlint

Functional try-catch wrapper.

Installation (npm)

npm i @playerony/try-catch-wrapper
yarn add @playerony/try-catch-wrapper

Usage

import { tryCatchWrapper, asyncTryCatchWrapper } from '@playerony/try-catch-wrapper';

const onSuccess = () => console.log('success');

const asyncOnSuccess = async () => Promise.resolve(10);

const onError = () => console.log('error');

tryCatchWrapper(onSuccess, onError);

asyncTryCatchWrapper(asyncOnSuccess, onError);