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