feat: allow render function to be asynchronous (#142)

This commit is contained in:
ʀᴀʏ
2022-04-23 15:17:00 +02:00
committed by GitHub
parent 49d2e54335
commit bb9fa4a09f
4 changed files with 12 additions and 11 deletions
+2 -2
View File
@@ -351,12 +351,12 @@ export class ServerContext {
params: Record<string, string>,
error?: unknown,
) => {
return (data?: Data) => {
return async (data?: Data) => {
if (page.component === undefined) {
throw new Error("This page does not have a component to render.");
}
const preloads: string[] = [];
const resp = internalRender({
const resp = await internalRender({
page,
islands: this.#islands,
app: this.#app,