Skip to content

Commit e28e9e4

Browse files
perf(web): the onboarding completion hook compiles without manual memoization
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent a702563 commit e28e9e4

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import { useCallback } from "react";
2-
31
import { ensureClientSettingsHydrated, persistClientSettingsUpdate } from "../hooks/useSettings";
42

3+
async function completeOnboarding(): Promise<void> {
4+
await ensureClientSettingsHydrated();
5+
const onboardingCompletedAt = new Date().toISOString();
6+
await persistClientSettingsUpdate((current) => ({ ...current, onboardingCompletedAt }));
7+
}
8+
59
export function useCompleteOnboarding(): () => Promise<void> {
6-
return useCallback(async () => {
7-
await ensureClientSettingsHydrated();
8-
const onboardingCompletedAt = new Date().toISOString();
9-
await persistClientSettingsUpdate((current) => ({ ...current, onboardingCompletedAt }));
10-
}, []);
10+
return completeOnboarding;
1111
}

0 commit comments

Comments
 (0)