Helper to run an async function and capture errors as a Result.
Result
Equivalent to fromPromise(fn(), onErr) but convenient for passing a function instead of a promise value.
fromPromise(fn(), onErr)
async function producing T
T
maps thrown values to an error of type E
E
a Promise<Result<T, E>>
Promise<Result<T, E>>
Helper to run an async function and capture errors as a
Result.Equivalent to
fromPromise(fn(), onErr)but convenient for passing a function instead of a promise value.