From 5f40814085e9cb6b44ce37a66d39a306f81f45ca Mon Sep 17 00:00:00 2001 From: "Gavri (Gabriel) Guy" Date: Sun, 15 Dec 2024 16:05:49 +0200 Subject: [PATCH] Resolve promises in suspense docs (#12531) * resolve promises * Update contributors.yml --- contributors.yml | 1 + docs/how-to/suspense.md | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/contributors.yml b/contributors.yml index efa72acaf7..0823c45469 100644 --- a/contributors.yml +++ b/contributors.yml @@ -98,6 +98,7 @@ - fyzhu - fz6m - gaspard +- gavriguy - Geist5000 - gesposito - gianlucca diff --git a/docs/how-to/suspense.md b/docs/how-to/suspense.md index 54064831d5..c048499d4f 100644 --- a/docs/how-to/suspense.md +++ b/docs/how-to/suspense.md @@ -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 };