Skip to content

Commit 23bdaba

Browse files
BalastrongKevinVandytannerlinsley
authored
fix: counters in the homepage no longer disappear on first load (#465)
Co-authored-by: Kevin Van Cott <[email protected]> Co-authored-by: Tanner Linsley <[email protected]>
1 parent db63753 commit 23bdaba

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

src/routes/_libraries/index.tsx

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import { Await, Link, MatchRoute, getRouteApi } from '@tanstack/react-router'
2+
import { convexQuery } from '@convex-dev/react-query'
3+
import { api } from 'convex/_generated/api'
24
import { twMerge } from 'tailwind-merge'
35
import { CgSpinner } from 'react-icons/cg'
46
import { Footer } from '~/components/Footer'
@@ -39,7 +41,20 @@ const courses = [
3941
]
4042

4143
export const Route = createFileRoute({
42-
loader: () => {
44+
loader: async ({ context: { queryClient } }) => {
45+
const githubQuery = queryClient.ensureQueryData(
46+
convexQuery(api.stats.getGithubOwner, {
47+
owner: 'tanstack',
48+
})
49+
)
50+
const npmQuery = queryClient.ensureQueryData(
51+
convexQuery(api.stats.getNpmOrg, {
52+
name: 'tanstack',
53+
})
54+
)
55+
56+
await Promise.all([githubQuery, npmQuery])
57+
4358
return {
4459
randomNumber: Math.random(),
4560
}

0 commit comments

Comments
 (0)