-
Notifications
You must be signed in to change notification settings - Fork 0
Variable.fromThrowableAsync
GitHub Actions edited this page May 22, 2025
·
1 revision
resultar / fromThrowableAsync
constfromThrowableAsync: <A,T,E>(fn,errorFn?) => (...args) =>ResultAsync<T,E> =ResultAsync.fromThrowable
Defined in: result-async.ts:477
Wraps a async function with a try catch, creating a new function with the same
arguments but returning Ok if successful, Err if the function throws
A extends readonly any[]
T
E
(...args) => Promise<T>
function to wrap with ok on success or err on failure
(err) => E
when an error is thrown, this will wrap the error result if provided
a new function that returns a ResultAsync
(...
args):ResultAsync<T,E>
...A
ResultAsync<T, E>