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
{{ message }}
Repository navigation
Commit 8bea7ff
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: src/content/reference/react/cacheSignal.md
+24-24Lines changed: 24 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,13 +4,13 @@ title: cacheSignal
4
4
5
5
<RSC>
6
6
7
-
`cacheSignal`is currently only used with[React Server Components](/blog/2023/03/22/react-labs-what-we-have-been-working-on-march-2023#react-server-components).
7
+
`cacheSignal`saat ini hanya digunakan dengan[React Server Components](/blog/2023/03/22/react-labs-what-we-have-been-working-on-march-2023#react-server-components).
8
8
9
9
</RSC>
10
10
11
11
<Intro>
12
12
13
-
`cacheSignal`allows you to know when the`cache()`lifetime is over.
13
+
`cacheSignal`memungkinkan Anda mengetahui kapan masa pakai`cache()`telah berakhir.
When React has finished rendering, the `AbortSignal`will be aborted. This allows you to cancel any in-flight work that is no longer needed.
39
-
Rendering is considered finished when:
40
-
- React has successfully completed rendering
41
-
-the render was aborted
42
-
-the render has failed
38
+
Ketika React telah selesai me-*render*, `AbortSignal`akan dibatalkan (*aborted*). Ini memungkinkan Anda membatalkan pekerjaan yang sedang berjalan (*in-flight work*) yang sudah tidak lagi diperlukan.
39
+
*Rendering* dianggap selesai ketika:
40
+
- React telah berhasil menyelesaikan *render*
41
+
-Proses *render* dibatalkan
42
+
-Proses *render* mengalami kegagalan
43
43
44
-
#### Parameters {/*parameters*/}
44
+
#### Parameter {/*parameters*/}
45
45
46
-
This function does not accept any parameters.
46
+
Fungsi ini tidak menerima parameter apa pun.
47
47
48
-
#### Returns {/*returns*/}
48
+
#### Nilai Kembalian {/*returns*/}
49
49
50
-
`cacheSignal`returns an `AbortSignal`if called during rendering. Otherwise `cacheSignal()`returns`null`.
50
+
`cacheSignal`mengembalikan `AbortSignal`jika dipanggil selama proses *rendering*. Selain itu, `cacheSignal()`mengembalikan nilai`null`.
51
51
52
-
#### Caveats {/*caveats*/}
52
+
#### Peringatan {/*caveats*/}
53
53
54
-
-`cacheSignal`is currently for use in [React Server Components](/reference/rsc/server-components) only. In Client Components, it will always return `null`. In the future it will also be used for Client Component when a client cache refreshes or invalidates. You should not assume it'll always be null on the client.
55
-
-If called outside of rendering, `cacheSignal`will return`null`to make it clear that the current scope isn't cached forever.
54
+
-`cacheSignal`saat ini hanya ditujukan untuk penggunaan di dalam [React Server Components](/reference/rsc/server-components). Pada Komponen Klien (*Client Components*), fungsi ini akan selalu mengembalikan `null`. Di masa mendatang fungsi ini juga akan digunakan untuk Komponen Klien ketika *cache* klien disegarkan atau diinvalidasi. Anda sebaiknya tidak mengasumsikan nilainya akan selalu `null` di sisi klien.
55
+
-Jika dipanggil di luar proses *rendering*, `cacheSignal`akan mengembalikan`null`untuk memperjelas bahwa cakupan (*scope*) saat ini tidak di-*cache* selamanya.
### Ignore errors after React has finished rendering {/*ignore-errors-after-react-has-finished-rendering*/}
86
+
### Mengabaikan galat setelah React selesai me-render {/*ignore-errors-after-react-has-finished-rendering*/}
87
87
88
-
If a function throws, it may be due to cancellation (e.g. <CodeStepstep={1}>the Database connection</CodeStep> has been closed). You can use the <CodeStepstep={2}>`aborted` property</CodeStep> to check if the error was due to cancellation or a real error. You may want to <CodeStepstep={3}>ignore errors</CodeStep> that were due to cancellation.
88
+
Jika sebuah fungsi melempar *error*, hal tersebut mungkin disebabkan oleh pembatalan (misalnya <CodeStepstep={1}>koneksi Basis Data</CodeStep> telah ditutup). Anda dapat menggunakan <CodeStepstep={2}>properti `aborted`</CodeStep> untuk memeriksa apakah galat tersebut disebabkan oleh pembatalan atau merupakan galat yang sebenarnya. Anda mungkin ingin <CodeStepstep={3}>mengabaikan galat</CodeStep> yang disebabkan oleh pembatalan.
0 commit comments