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
Introduced the `defer` directive to enable incremental loading for single queries, improving performance and user experience by allowing partial data to be rendered as it becomes available.
Copy file name to clipboardExpand all lines: apps/docs/react/guides/incremental-loading.md
+31-1Lines changed: 31 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,36 @@ sidebar_position: 4
4
4
5
5
# Incremental loading
6
6
7
+
## `defer`
8
+
9
+
The `defer` directive may be specified on a query to imply de-prioritization, that causes the data to be in [`pending`](/api/core#pending) state in the initial response, and delivered as a subsequent response afterward. For React, this can also be used to opt-out of suspending.
10
+
11
+
:::info
12
+
13
+
When you pass `{ defer: true }` to the query, the result will now be either:
14
+
15
+
- A resolved value (the response you expect), or
16
+
- A special [`pending`](/api/core#pending) symbol from `@reactive-dot/core`, indicating that the data hasn’t arrived yet.
For multi-entry queries like `storages`, `runtimeApis`, etc., the `stream` directive allows the client to receive partial results as they become available, before the entire response is ready.
@@ -35,7 +65,7 @@ This works well for a small number of accounts, where results load quickly. But
35
65
When you pass `{ stream: true }` to the query, each item in the result array will now be either:
36
66
37
67
- A resolved value (the response you expect), or
38
-
- A special `pending` symbol from `@reactive-dot/core`, indicating that the data for that item hasn’t arrived yet.
68
+
- A special [`pending`](/api/core#pending) symbol from `@reactive-dot/core`, indicating that the data for that item hasn’t arrived yet.
Copy file name to clipboardExpand all lines: apps/docs/vue/guides/incremental-loading.md
+28Lines changed: 28 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,34 @@ sidebar_position: 3
4
4
5
5
# Incremental loading
6
6
7
+
## `defer`
8
+
9
+
The `defer` directive may be specified on a query to imply de-prioritization, that causes the data to be in [`pending`](/api/core#pending) state in the initial response, and delivered as a subsequent response afterward.
10
+
11
+
:::info
12
+
13
+
When you pass `{ defer: true }` to the query, the result will now be either:
14
+
15
+
- A resolved value (the response you expect), or
16
+
- A special [`pending`](/api/core#pending) symbol from `@reactive-dot/core`, indicating that the data hasn’t arrived yet.
17
+
18
+
:::
19
+
20
+
```vue
21
+
<script setup lang="ts">
22
+
import { useLazyLoadQuery } from "@reactive-dot/vue";
For multi-entry queries like `storages`, `runtimeApis`, etc., the `stream` directive allows the client to receive partial results as they become available, before the entire response is ready.
0 commit comments