Skip to content

tijnjh/typecatch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

typecatch

Simple TypeScript tryCatch util function for both sync and async

Installation

npm i typecatch

Usage

import { tryCatch } from "typecatch";

// function:
const { data, error } = tryCatch(() => JSON.parse(/* ... */));

// promise:
const { data, error } = await tryCatch(fetch(/* ... */));

About

Simple TypeScript tryCatch util function for both sync and async

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published