Getting started
Installation
yarn add @replygirl/tc
Basic usage
import tc from '@replygirl/tc'
const [x] = tc(() => true)
console.info(x) // true
const [y, e] = tc(() => { throw new Error() })
console.info(y ?? e) // Error
yarn add @replygirl/tc
import tc from '@replygirl/tc'
const [x] = tc(() => true)
console.info(x) // true
const [y, e] = tc(() => { throw new Error() })
console.info(y ?? e) // Error