Skip to content

Variable.fromSafePromise

GitHub Actions edited this page May 22, 2025 · 1 revision

resultar / fromSafePromise

Variable: fromSafePromise()

const fromSafePromise: <T, E>(promise) => ResultAsync<T, E> = ResultAsync.fromSafePromise

Defined in: result-async.ts:475

Returns a ResultAsync instance that is resolved with a Result.ok(value) or Result.err(error) based on the provided promise.

Type Parameters

T

T

E

E = never

Parameters

promise

PromiseLike<T>

The promise to be wrapped in a ResultAsync.

Returns

ResultAsync<T, E>

A ResultAsync instance with the given promise and error type E.

Clone this wiki locally