MCPcopy Create free account
hub / github.com/triggerdotdev/jsonhero-web / loader

Function loader

app/routes/index.tsx:20–31  ·  view source on GitHub ↗
({ request }: { request: Request })

Source from the content-addressed store, hash-verified

18type LoaderData = { toastMessage?: ToastMessage };
19
20export async function loader({ request }: { request: Request }) {
21 const cookie = request.headers.get("cookie");
22 const session = await getSession(cookie);
23 const toastMessage = session.get("toastMessage") as ToastMessage;
24
25 return json(
26 { toastMessage },
27 {
28 headers: { "Set-Cookie": await commitSession(session) },
29 }
30 );
31}
32export default function Index() {
33 const { toastMessage } = useLoaderData<LoaderData>();
34

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected