Skip to content
This repository was archived by the owner on Dec 13, 2023. It is now read-only.

Repository files navigation

try-catch

Travis Build Status Coverage Status Dependencies Known Vulnerabilities semantic-release styled with prettier

About

Use try-catch statements in a more convenient way with this package.

Installation

yarn add @orlovsky/try-catch

or

npm i @orlovsky/try-catch

Usage

import { tryCatch } from '@orlovsky/try-catch';

// ...

const [error, result] = tryCatch(() => someFnThatMayThrow());

if (error) {
  // do something with error
  return;
}

// do something with result

Additional info

Inspired by try-catch.
Created with typescript-library-starter.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages