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

Function createToastHeaders

app/utils/toast.server.ts:40–46  ·  view source on GitHub ↗
(toastInput: ToastInput)

Source from the content-addressed store, hash-verified

38}
39
40export async function createToastHeaders(toastInput: ToastInput) {
41 const session = await toastSessionStorage.getSession()
42 const toast = ToastSchema.parse(toastInput)
43 session.flash(toastKey, toast)
44 const cookie = await toastSessionStorage.commitSession(session)
45 return new Headers({ 'set-cookie': cookie })
46}
47
48export async function getToast(request: Request) {
49 const session = await toastSessionStorage.getSession(

Callers 3

actionFunction · 0.90
loaderFunction · 0.90
redirectWithToastFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected