Want this?
const [result, error] = try await asyncMightFail();
Do this!
const [result, error] = await try_(asyncMightFail());
Inspired by Matt Pocock's tweet:
import { try_ } from "safe-try";
const [result, error] = await try_(asyncMightFail());
Want this?
const [result, error] = try await asyncMightFail();
Do this!
const [result, error] = await try_(asyncMightFail());
Inspired by Matt Pocock's tweet:
import { try_ } from "safe-try";
const [result, error] = await try_(asyncMightFail());
npm i safe-try
10
0.0.4
MIT
3.07 kB
5