A result is a type that can be either an Ok or an Err.
Ok
Err
It represents the result of an operation.
The two variants are mutually exclusive.
const result: Result<number, string> = ok(1);const error: Result<number, string> = err("error"); Copy
const result: Result<number, string> = ok(1);const error: Result<number, string> = err("error");
const tryResult: Result<number, unknown> = try$(() => { return 1;}); Copy
const tryResult: Result<number, unknown> = try$(() => { return 1;});
A result is a type that can be either an
Okor anErr.It represents the result of an operation.
The two variants are mutually exclusive.