From 206656c1dde1e7ef0305ed169fc5ae9e31f607ea Mon Sep 17 00:00:00 2001 From: Cody Olsen Date: Thu, 21 Nov 2024 04:14:57 +0100 Subject: [PATCH] Update ThemeButton.tsx --- tanstack-start/app/components/ThemeButton.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tanstack-start/app/components/ThemeButton.tsx b/tanstack-start/app/components/ThemeButton.tsx index abd47c5..213604a 100644 --- a/tanstack-start/app/components/ThemeButton.tsx +++ b/tanstack-start/app/components/ThemeButton.tsx @@ -6,6 +6,9 @@ const randomColorTheme = createServerFn().handler(async () => { method: 'PUT', }) + // Wait 1 second to stagger requests a little bit + await new Promise((resolve) => setTimeout(resolve, 1_000)) + return res.json() })