happy-rusty
    Preparing search index...

    Type Alias VoidResult<E>

    VoidResult: Result<void, E>

    Similar to Rust's Result<(), E>.

    Type Parameters

    • E

      The type of the error that may be produced by a failed operation.

    1.4.0

    function saveData(data: string): VoidResult<Error> {
    if (!data) {
    return Err(new Error('Empty data'));
    }
    localStorage.setItem('data', data);
    return Ok();
    }