You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/tutorial/02-sveltekit/04-forms/05-customizing-use-enhance/README.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
title: Customizing use:enhance
3
3
---
4
4
5
-
With `use:enhance`, we can go further than just emulating the browser's native behaviour. By providing a callback, we can add things like **pending states**and**optimistic UI**. Let's simulate a slow network by adding an artificial delay to our two actions:
When we create or delete items, it now takes a full second before the UI updates, leaving the user wondering if they messed up somehow. To solve that, add some local state...
@@ -89,4 +89,4 @@ In the case of deletions, we don't really need to wait for the server to validat
89
89
</ul>
90
90
```
91
91
92
-
> `use:enhance`is very customizable — you can `cancel()` submissions, handle redirects, control whether the form is reset, and so on. [See the docs](https://kit.svelte.dev/docs/modules#$app-forms-enhance) for full details.
0 commit comments