https://github.com/playerony/try-catch-wrapper
Functional try-catch wrapper.
https://github.com/playerony/try-catch-wrapper
javascript react-try-catch try-catch try-catch-wrapper typescript typescript-library
Last synced: 5 months ago
JSON representation
Functional try-catch wrapper.
- Host: GitHub
- URL: https://github.com/playerony/try-catch-wrapper
- Owner: playerony
- Created: 2021-09-04T17:11:14.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-09-06T17:16:38.000Z (almost 4 years ago)
- Last Synced: 2025-02-04T03:48:39.538Z (5 months ago)
- Topics: javascript, react-try-catch, try-catch, try-catch-wrapper, typescript, typescript-library
- Language: TypeScript
- Homepage:
- Size: 103 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# try catch wrapper





Functional try-catch wrapper.
- [API Docs](https://playerony.github.io/try-catch-wrapper)
# Installation ([npm](https://www.npmjs.com/package/@playerony/try-catch-wrapper))
```
npm i @playerony/try-catch-wrapper
``````
yarn add @playerony/try-catch-wrapper
```# Usage
```js
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);
```