mise API - v0.0.0
    Preparing search index...

    Type Alias Result<T>

    Result: { ok: true; value: T } | { ok: false }

    Result type representing success or failure.

    Type Parameters

    • T
    async function getData(): Promise<Result<Data>> {
    if (error) {
    errorStack.stack_push("error", "Failed to get data");
    return Err();
    }
    return Ok(data);
    }

    const result = await getData();
    if (!result.ok) {
    // Can't access result.value here - TypeScript error
    console.log(errorStack.stack_search("data"));
    return;
    }
    // TypeScript knows result.ok === true, so .value exists
    useData(result.value);