FormSubmitResult type alias

Module @runic-artifex/views in @runic-artifex/views 0.23.0

type FormSubmitResult<T> = {
    readonly status: "submitted";
    readonly result: T;
} | {
    readonly status: "field-failed";
    readonly error: unknown;
} | {
    readonly status: "validating";
} | {
    readonly status: "busy";
};

How a submit ended: - submitted: the fields' writes settled and the command ran; result is what it returned; - field-failed: a field's value did not reach the View, so the command did not run; error is the first such field's error: a text that does not parse (invalid-text), a rejected or conflict checked write, or a transport failure of this submit's writes. A committed-with-error write reached the View and does not block; - validating: with waitForValidation, a field's validation was still in progress when the wait ended; - busy: another submit of the form was running, so neither the fields nor the command were touched. A command that throws rejects the submit promise with its error.