Skip to content

API reference > @kontsedal/olas-core > SubmitResult

SubmitResult type ​

What Form.submit resolves with. ok: true carries the handler's result.ok: false names why the handler did not succeed: - 'invalid' — pre-submit validation failed; every leaf is marked touched. - 'error' — the handler threw; error is the thrown value. - 'busy' — a submission was already in flight, so this one did not start. - 'disposed' — the form was disposed.

Signature:

typescript
type SubmitResult<R> = {
  readonly ok: true;
  readonly data: R;
} | {
  readonly ok: false;
  readonly reason: 'invalid' | 'busy' | 'disposed';
} | {
  readonly ok: false;
  readonly reason: 'error';
  readonly error: unknown;
};

Released under the MIT License.