callNotifiedForm()function
callNotifiedForm(value: T, store: FormStore<T>, form: HTMLFormElement, callback?: NoticeCallback<[T, ...A]>, ...args: A): boolean | Promise<boolean>
| Param | Type | |
|---|---|---|
value | T | The validated form data passed to the callback. required |
store | FormStore<T> | The FormStore the form is bound to. required |
form | HTMLFormElement | The underlying HTMLFormElement notices are anchored to. required |
callback | NoticeCallback<[T, ...A]> | Optional callback to run with the value and extra args. |
args | A | 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.
- Strings returned are shown as success notices; thrown values are routed through
notifyThrownForm(). - Async callbacks are awaited via
awaitNotifiedForm().
Examples
callNotifiedForm(data, store, formEl, onSubmit, event)