# @talesoft/frame-loop

> @talesoft/try-catch =====================

Latest version **0.1.1-alpha.0** (published 2021-08-31) · MIT license · 0 weekly downloads

## Install

```sh
npm install @talesoft/frame-loop
pnpm add @talesoft/frame-loop
yarn add @talesoft/frame-loop
bun add @talesoft/frame-loop
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1-alpha.0 |
| Published | 2021-08-31 |
| First published | 2021-08-31 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | torben-koehn, torbenkoehn, simonekruegel |

## Links

- npm: https://www.npmjs.com/package/@talesoft/frame-loop
- npm.io page: https://npm.io/package/@talesoft/frame-loop

## Recent versions

- 0.1.1-alpha.0 (latest) — 2021-08-31

## README

@talesoft/try-catch
=====================

A simple functional wrapper for a try-catch statement.

Makes it easier to handle exceptions immutably.

Usage
=====

```ts
import tryCatch from '@talesoft/try-catch'

function somethingThatCanThrow() {

  if (amIWrong()) {

    throw new Error('I\'m wrong!')
  }

  return 'Some result'
}

const result = tryCatch(somethingThatCanThrow)

// result is of type `string | Error`

const alwaysResult = tryCatch(somethingThatCanThrow, () => 'Other result')

// alwaysResult is of type `string` ('Some result' or 'Other result')

const alwaysResult = tryCatch(somethingThatCanThrow, error => error.message)

// alwaysResult is of type `string` ('Some result' or 'I\'m wrong!')
```

---
_Source: https://npm.io/package/@talesoft/frame-loop · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
