callNotifiedForm()function

callNotifiedForm(value: T, store: FormStore<T>, form: HTMLFormElement, callback?: NoticeCallback<[T, ...A]>, ...args: A): boolean | Promise<boolean>
ParamType
valueT
The validated form data passed to the callback. required
storeFormStore<T>
The FormStore the form is bound to. required
formHTMLFormElement
The underlying HTMLFormElement notices are anchored to. required
callbackNoticeCallback<[T, ...A]>
Optional callback to run with the value and extra args.
argsA
Additional arguments forwarded to the callback. required
Return
boolean | Promise<boolean>
true on success, false on failure (or a Promise resolving to one).

Run a form submit callback and publish success/error notices based on its return or thrown value.

Examples

callNotifiedForm(data, store, formEl, onSubmit, event)