Skip to content

Commit 7f995dc

Browse files
Attempt to clarify use:enhance docs (#13819)
* attempt to clarify use:enhance docs * Update documentation/docs/20-core-concepts/30-form-actions.md --------- Co-authored-by: Elliott Johnson <[email protected]>
1 parent ea2ac9b commit 7f995dc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

documentation/docs/20-core-concepts/30-form-actions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ Without an argument, `use:enhance` will emulate the browser-native behaviour, ju
368368
369369
### Customising use:enhance
370370
371-
To customise the behaviour, you can provide a `SubmitFunction` that runs immediately before the form is submitted, and (optionally) returns a callback that runs with the `ActionResult`. Note that if you return a callback, the default behavior mentioned above is not triggered. To get it back, call `update`.
371+
To customise the behaviour, you can provide a `SubmitFunction` that runs immediately before the form is submitted, and (optionally) returns a callback that runs with the `ActionResult`.
372372
373373
```svelte
374374
<form
@@ -390,7 +390,7 @@ To customise the behaviour, you can provide a `SubmitFunction` that runs immedia
390390
391391
You can use these functions to show and hide loading UI, and so on.
392392
393-
If you return a callback, you may need to reproduce part of the default `use:enhance` behaviour, but without invalidating all data on a successful response. You can do so with `applyAction`:
393+
If you return a callback, you override the default post-submission behavior. To get it back, call `update`, which accepts `invalidateAll` and `reset` parameters, or use `applyAction` on the result:
394394
395395
```svelte
396396
/// file: src/routes/login/+page.svelte

0 commit comments

Comments
 (0)