Skip to content
Source
Sign inSign up
fuko/trytanstackdb.com
Open History to see the last commit

getTutorialDataFromCookie.ts

11 lines391 Bytes

1import { createServerFn } from "@tanstack/react-start";
2import { getCookie } from "@tanstack/react-start/server";
3import { TUTORIAL_COOKIE_NAME } from "@/utils/getTutorialDataHandlers";
4​
5export const getTutorialDataFromCookie = createServerFn().handler(
6 async (): Promise<string | undefined> => {
7 const tutorialData = getCookie(TUTORIAL_COOKIE_NAME);
8​
9 return tutorialData;
10 },
11);