easy-try-catch
v0.2.0
Published
Simple tryCatch util function for both sync and async
Downloads
6
Readme
easy-try-catch
Simple tryCatch util function for both sync and async
Installation
npm i easy-try-catchUsage
Function:
const { data, error } = tryCatch(() => JSON.parse(/* ... */));Promise
const { data, error } = await tryCatch(fetch(/* ... */));