Skip to content

Commit

Permalink
Resolve promises in suspense docs (remix-run#12531)
Browse files Browse the repository at this point in the history
* resolve promises

* Update contributors.yml
  • Loading branch information
gavriguy authored Dec 15, 2024
1 parent 0a6bdec commit 5f40814
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions contributors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@
- fyzhu
- fz6m
- gaspard
- gavriguy
- Geist5000
- gesposito
- gianlucca
Expand Down
4 changes: 2 additions & 2 deletions docs/how-to/suspense.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ import type { Route } from "./+types/my-route";
export async function loader({}: Route.LoaderArgs) {
// note this is NOT awaited
let nonCriticalData = new Promise((res) =>
setTimeout(() => "non-critical", 5000)
setTimeout(() => res("non-critical"), 5000)
);

let criticalData = await new Promise((res) =>
setTimeout(() => "critical", 300)
setTimeout(() => res("critical"), 300)
);

return { nonCriticalData, criticalData };
Expand Down

0 comments on commit 5f40814

Please sign in to comment.