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
Functional try-catch wrapper.
Installation (npm)
npm i @playerony/try-catch-wrapperyarn add @playerony/try-catch-wrapperUsage
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);