@playerony/try-catch-wrapper

Functional try-catch wrapper.

Usage no npm install needed!

<script type="module">
  import playeronyTryCatchWrapper from 'https://cdn.skypack.dev/@playerony/try-catch-wrapper';
</script>

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);