pull/16748/head
S. Elliott Johnson 4 weeks ago
parent 903f1f1c08
commit d694c57e8c

@ -5,7 +5,7 @@ import * as e from './internal/server/errors.js';
/** @param {() => void} fn */ /** @param {() => void} fn */
export function onDestroy(fn) { export function onDestroy(fn) {
/** @type {SSRContext} */ (ssr_context).r.on_destroy(fn); /** @type {SSRContext} */ (ssr_context).r?.on_destroy(fn);
} }
export { export {

@ -74,6 +74,7 @@ export function render(component, options = {}) {
if (options.context) { if (options.context) {
push(); push();
/** @type {SSRContext} */ (ssr_context).c = options.context; /** @type {SSRContext} */ (ssr_context).c = options.context;
/** @type {SSRContext} */ (ssr_context).r = payload;
} }
// @ts-expect-error // @ts-expect-error
@ -98,7 +99,7 @@ export function render(component, options = {}) {
return { return {
head, head,
html: body, html: body,
body: body body
}; };
} finally { } finally {
abort(); abort();
@ -127,6 +128,7 @@ export async function render_async(component, options = {}) {
if (options.context) { if (options.context) {
push(); push();
/** @type {SSRContext} */ (ssr_context).c = options.context; /** @type {SSRContext} */ (ssr_context).c = options.context;
/** @type {SSRContext} */ (ssr_context).r = payload;
} }
// @ts-expect-error // @ts-expect-error
@ -151,7 +153,7 @@ export async function render_async(component, options = {}) {
return { return {
head, head,
html: body, html: body,
body: body body
}; };
} finally { } finally {
abort(); abort();

Loading…
Cancel
Save