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: docs/utils/defer.md
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -6,15 +6,15 @@ title: defer
6
6
7
7
This is a shortcut for creating a streaming/deferred response. It assumes you are using `utf-8` encoding. From a developer perspective it behaves just like [`json()`][json], but with the ability to transport promises to your UI components.
8
8
9
-
```ts lines=[2,6]
9
+
```ts lines=[2,5,10]
10
10
importtype { LoaderFunction } from"@remix-run/node"; // or cloudflare/deno
11
-
import { json } from"@remix-run/node"; // or cloudflare/deno
11
+
import { defer } from"@remix-run/node"; // or cloudflare/deno
12
12
13
13
exportconst loader:LoaderFunction=async () => {
14
14
const aStillRunningPromise =loadSlowDataAsync();
15
15
16
16
// So you can write this without awaiting the promise:
0 commit comments