MCPcopy
hub / github.com/epicweb-dev/epic-stack / getToast

Function getToast

app/utils/toast.server.ts:48–62  ·  view source on GitHub ↗
(request: Request)

Source from the content-addressed store, hash-verified

46}
47
48export async function getToast(request: Request) {
49 const session = await toastSessionStorage.getSession(
50 request.headers.get('cookie'),
51 )
52 const result = ToastSchema.safeParse(session.get(toastKey))
53 const toast = result.success ? result.data : null
54 return {
55 toast,
56 headers: toast
57 ? new Headers({
58 'set-cookie': await toastSessionStorage.destroySession(session),
59 })
60 : null,
61 }
62}

Callers 1

loaderFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected