vapor-chamber API reference - v1.16.0
    Preparing search index...

    Type Alias CommandResult<V>

    CommandResult:
        | { ok: true; value?: V; error?: undefined }
        | { ok: false; error: Error; value?: undefined }

    Result of a dispatch/query — a discriminated union on ok.

    if (result.ok) narrows away error; on the failure arm error is a guaranteed Error (no ! or ?. needed). value stays optional on the success arm because void commands legitimately produce no value.

    Type Parameters

    • V = any