-
Notifications
You must be signed in to change notification settings - Fork 0
Function.fromPromise
GitHub Actions edited this page Mar 5, 2025
·
27 revisions
resultar / fromPromise
fromPromise<
T,E>(promise,errorFn):ResultAsync<T,E>
Defined in: result-async.ts:470
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.