The type of the value in the result.
The type of the expected error in the result.
A PendingResult resolving to the provided or produced result.
const x = pendingResult(ok<number, string>(42));
const y = pendingResult(() => Promise.resolve(err<string, number>(42)));
const z = pendingResult(async () => err<string, boolean>(true));
expect(await x).toStrictEqual(ok(42));
expect(await y).toStrictEqual(err(42));
expect(await z).toStrictEqual(err(true));
Creates a PendingResult<T, E> from a result, promise, or factory function.
Accepts a Result, a
Promise
resolving to a Result, or a function returning either, and converts it into a pending result, handling asynchronous resolution as needed.