Skip to content

results-ts


results-ts / Result

Type Alias: Result<T, E>

Result<T, E> = OkResult<T, E> | ErrResult<T, E>

Defined in: result.ts:44

Result<T, E> is the type used for returning and propagating errors.

It is a type with the parameters, Ok(T), representing success and containing a value, and Err(E), representing error and containing an error value.

Functions return Result whenever errors are expected and recoverable.

Type Parameters

T

T

Contains the success value.

E

E

Contains the error value.