-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor(twemoji): Extract generateSSGHelper function
- Loading branch information
Showing
2 changed files
with
20 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
fullstack/twitter-with-only-emojis-theo-t3-stack-tutorial/src/server/helpers/ssgHelper.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { createServerSideHelpers } from "@trpc/react-query/server"; | ||
import { appRouter } from "~/server/api/root"; | ||
import { prisma } from "~/server/db"; | ||
import SuperJSON from "superjson"; | ||
|
||
export const generateSSGHelper = () => | ||
createServerSideHelpers({ | ||
router: appRouter, | ||
ctx: { | ||
prisma, | ||
userId: null, | ||
}, | ||
transformer: SuperJSON, // optional - adds superjson serialization | ||
}); |