Skip to content

guard

A helper to try an async function that returns undefined if it fails.

Usage

const result = (await guard(fetchUsers)()) ?? [];

Installation

Terminal window
npx atmx add helper guard