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

    Type Alias FormBusOptions<T>

    type FormBusOptions<T extends Record<string, any>> = {
        fields: T;
        rules?: FormRules<T>;
        onSubmit?: (values: T) => void | Promise<void>;
        reactive?: boolean;
        bus?: CommandBus;
    }

    Type Parameters

    • T extends Record<string, any>
    Index

    Properties

    fields: T

    Initial field values — also used as the reset target.

    rules?: FormRules<T>

    Per-field validation rules. Return a string on error, null on pass.

    onSubmit?: (values: T) => void | Promise<void>

    Called after successful validation on submit(). May be async.

    reactive?: boolean

    Create reactive signals for all form state (values, errors, isDirty, etc.). Default: true. Set to false for headless / server-side / batch use cases where reactivity is not needed — avoids 7 signal allocations per form. When false, all Signal fields still work as plain get/set wrappers.

    Inject an external command bus instead of creating an isolated one. When provided, form commands (formSet, formTouch, formReset, formValidate) flow through this bus — making them visible to DevTools, metrics, logger, and global listeners.

    const bus = getCommandBus();
    const form = createFormBus({ fields: { email: '' }, bus });
    // formSet, formTouch, etc. now visible in setupDevtools()