Skip to content

Commit

Permalink
docs: add options for enhance update (#13022)
Browse files Browse the repository at this point in the history
closes #13020

---------

Co-authored-by: Chew Tee Ming <chew.tee.ming@nindatech.com>
  • Loading branch information
russ3llc and eltigerchino authored Jan 15, 2025
1 parent 7c2c104 commit fb04de2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/kit/src/runtime/app/forms.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ function clone(element) {
* - redirects to the nearest error page in case of an unexpected error
*
* If you provide a custom function with a callback and want to use the default behavior, invoke `update` in your callback.
* It accepts an options object
* - `reset: false` if you don't want the `<form>` values to be reset after a successful submission
* - `invalidateAll: false` if you don't want the action to call `invalidateAll` after submission
* @template {Record<string, unknown> | undefined} Success
* @template {Record<string, unknown> | undefined} Failure
* @param {HTMLFormElement} form_element The form element
Expand Down
3 changes: 3 additions & 0 deletions packages/kit/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2136,6 +2136,9 @@ declare module '$app/forms' {
* - redirects to the nearest error page in case of an unexpected error
*
* If you provide a custom function with a callback and want to use the default behavior, invoke `update` in your callback.
* It accepts an options object
* - `reset: false` if you don't want the `<form>` values to be reset after a successful submission
* - `invalidateAll: false` if you don't want the action to call `invalidateAll` after submission
* @param form_element The form element
* @param submit Submit callback
*/
Expand Down

0 comments on commit fb04de2

Please sign in to comment.