Skip to content

Commit 075f66f

Browse files
03-sveltekit/06-forms/05-customizing-use-enhance (#134)
Co-authored-by: Kim, Hyeonseo <dodok8@gmail.com>
1 parent 0ad48b4 commit 075f66f

File tree

1 file changed

+7
-7
lines changed
  • content/tutorial/03-sveltekit/06-forms/05-customizing-use-enhance

1 file changed

+7
-7
lines changed

content/tutorial/03-sveltekit/06-forms/05-customizing-use-enhance/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
2-
title: Customizing use:enhance
2+
title: use:enhance 커스터마이징하기
33
---
44

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:
5+
`use:enhance`를 이용하면 브라우저의 기본 동작을 에뮬레이션하는 것보다 더 많은 일을 할 수 있습니다. 콜백을 제공함으로써 **대기 상태** **낙관적 UI**와 같은 기능을 추가할 수 있습니다. 두 액션에 인위적인 지연을 추가하여 느린 네트워크를 시뮬레이션해 봅시다.
66

77
```js
88
/// file: src/routes/+page.server.js
@@ -19,7 +19,7 @@ export const actions = {
1919
};
2020
```
2121

22-
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...
22+
항목을 생성하거나 삭제할 때, UI가 업데이트되기까지 1초가 걸리므로 사용자가 혼란스러워할 수 있습니다. 이를 해결하기 위해 로컬 상태를 추가합시다.
2323

2424
```svelte
2525
/// file: src/routes/+page.svelte
@@ -35,7 +35,7 @@ When we create or delete items, it now takes a full second before the UI updates
3535
</script>
3636
```
3737

38-
...and toggle `creating` inside the first `use:enhance`:
38+
그리고 첫 번째 `use:enhance` 안에서 `creating`을 토글합시다.
3939

4040
```svelte
4141
/// file: src/routes/+page.svelte
@@ -64,7 +64,7 @@ When we create or delete items, it now takes a full second before the UI updates
6464
</form>
6565
```
6666

67-
We can then show a message while we're saving data:
67+
그러고 나면 데이터를 저장하는 동안 메시지를 표시할 수 있습니다.
6868

6969
```svelte
7070
/// file: src/routes/+page.svelte
@@ -77,7 +77,7 @@ We can then show a message while we're saving data:
7777
{/if}+++
7878
```
7979

80-
In the case of deletions, we don't really need to wait for the server to validate anything — we can just update the UI immediately:
80+
삭제의 경우, 서버가 무언가를 검증하기를 기다릴 필요가 없이 바로 UI를 업데이트할 수 있습니다.
8181

8282
```svelte
8383
/// file: src/routes/+page.svelte
@@ -105,4 +105,4 @@ In the case of deletions, we don't really need to wait for the server to validat
105105
</ul>
106106
```
107107

108-
> `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.
108+
> `use:enhance`는 아주 다양하게 사용 가능합니다. 제출을 `cancel()`하거나, 리디렉션을 처리하고, 폼의 리셋 여부를 제어하는 등의 작업을 할 수 있습니다. [문서](https://kit.svelte.dev/docs/modules#$app-forms-enhance)에서 자세한 내용을 확인하세요.

0 commit comments

Comments
 (0)