ResultMaybeAsync<
T,E> =Result<T,E> |Promise<Result<T,E>>
Defined in: result.ts:116
A result that may be either synchronous or asynchronous.
T
The type of the Success value.
E
The type of the Failure value.
import { import Result Result } from '@praha/byethrow';
const const result: Result.ResultMaybeAsync<number, string> result : import Result Result .type ResultMaybeAsync<T, E> = Result.Result<T, E> | Promise<Result.Result<T, E>>A result that may be either synchronous or asynchronous.
ResultMaybeAsync <number, string> = { type: "Success" type : 'Success', value: number value : 10 };import { import Result Result } from '@praha/byethrow';
const const result: Result.ResultMaybeAsync<number, string> result : import Result Result .type ResultMaybeAsync<T, E> = Result.Result<T, E> | Promise<Result.Result<T, E>>A result that may be either synchronous or asynchronous.
ResultMaybeAsync <number, string> = var Promise: PromiseConstructorRepresents the completion of an asynchronous operation
Promise .PromiseConstructor.resolve<{
type: "Failure";
error: string;
}>(value: {
type: "Failure";
error: string;
}): Promise<{
type: "Failure";
error: string;
}> (+2 overloads)
Creates a new resolved promise for the provided value.
resolve ({ type: "Failure" type : 'Failure', error: string error : 'error' });