Skip to content

Commit 5f40814

Browse files
authored
Resolve promises in suspense docs (#12531)
* resolve promises * Update contributors.yml
1 parent 0a6bdec commit 5f40814

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

contributors.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@
9898
- fyzhu
9999
- fz6m
100100
- gaspard
101+
- gavriguy
101102
- Geist5000
102103
- gesposito
103104
- gianlucca

docs/how-to/suspense.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ import type { Route } from "./+types/my-route";
1818
export async function loader({}: Route.LoaderArgs) {
1919
// note this is NOT awaited
2020
let nonCriticalData = new Promise((res) =>
21-
setTimeout(() => "non-critical", 5000)
21+
setTimeout(() => res("non-critical"), 5000)
2222
);
2323

2424
let criticalData = await new Promise((res) =>
25-
setTimeout(() => "critical", 300)
25+
setTimeout(() => res("critical"), 300)
2626
);
2727

2828
return { nonCriticalData, criticalData };

0 commit comments

Comments
 (0)