-
Notifications
You must be signed in to change notification settings - Fork 0
Variable.fromPromise
GitHub Actions edited this page May 22, 2025
·
1 revision
resultar / fromPromise
constfromPromise: <T,E>(promise,errorFn) =>ResultAsync<T,E> =ResultAsync.fromPromise
Defined in: result-async.ts:474
Returns a ResultAsync instance that is resolved with a Result.ok(value) or Result.err(error) based on the provided promise.
T
E
PromiseLike<T>
The promise to be wrapped in a ResultAsync.
(e) => E
A function that transforms the error from the promise into the error type E.
ResultAsync<T, E>
A ResultAsync instance with the given promise and error type E.