Radash
  1. Async
  2. tryit

Basic usage

Error-first callbacks were cool. Using mutable variables to hoist state when doing try/catch was not cool.

The _.try function let’s you wrap a function to convert it to an error-first async function.

import { tryit } from 'radash'

const [err, user] = await tryit(api.users.find)(userId)

Currying

You can curry try if you like.

import { tryit } from 'radash'

const findUser = tryit(api.users.find)

const [err, user] = await findUser(userId)