MCPcopy Index your code
hub / github.com/solidjs/solid-start / initFromFlash

Function initFromFlash

packages/start/src/server/handler.ts:180–200  ·  view source on GitHub ↗
(ctx: FetchEvent)

Source from the content-addressed store, hash-verified

178}
179
180function initFromFlash(ctx: FetchEvent) {
181 const flash = getCookie(ctx.nativeEvent, "flash");
182 if (!flash) return;
183 try {
184 const param = JSON.parse(flash);
185 if (!param || !param.result) return;
186 const input = [...param.input.slice(0, -1), new Map(param.input[param.input.length - 1])];
187 const result = param.error ? new Error(param.result) : param.result;
188 return {
189 input,
190 url: param.url,
191 pending: false,
192 result: param.thrown ? undefined : result,
193 error: param.thrown ? result : undefined,
194 };
195 } catch (e) {
196 console.error(e);
197 } finally {
198 setCookie(ctx.nativeEvent, "flash", "", { maxAge: 0 });
199 }
200}
201
202function handleShellCompleteRedirect(context: PageEvent, e: H3Event) {
203 return () => {

Callers 1

createPageEventFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…