withEventFormValue
Enables automatic form value attachment to all events dispatched through the EventBus.
When this feature is enabled, events dispatched via eventBus.dispatch() will include the current form value in the formValue property. This is useful for event handlers that need access to the complete form state at the time of the event.
Notes
Precedence rules:
- Per-form
false- Disables for this form, regardless of global setting - Per-form
true- Enables for this form, regardless of global setting - Per-form
undefined- Uses global setting - Global
- Enables globallywithEventFormValue () - No global feature - Disabled globally (default)
Presentation
function withEventFormValue (): DynamicFormFeature <"event-form-value">;Returns
DynamicFormFeature <"event-form-value"> -A DynamicFormFeature that enables form value attachment to events
Example usage
Global opt-in
Consumer usage
eventBus.on<SubmitEvent >('submit').subscribe(event => {
if (hasFormValue (event)) {
console.log('Form value:', event.formValue);
}
});Per-form disable (when globally enabled)
const config: FormConfig = {
fields: [...],
options: { emitFormValueOnEvents: false }
};