Skip to content

Instantly share code, notes, and snippets.

View edilson258's full-sized avatar

Edilson Pateguana edilson258

View GitHub Profile
class Result<T, E> {
private readonly value: T | null;
private readonly error: E | null;
private constructor(value: T | null, error: E | null) {
this.value = value;
this.error = error;
}
static ok<T, E = never>(value: T): Result<T, E> {