feat: allow render function to be asynchronous (#142)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { RenderContext, RenderFn } from "../../../server.ts";
|
||||
|
||||
export function render(_ctx: RenderContext, render: RenderFn) {
|
||||
export async function render(_ctx: RenderContext, render: RenderFn) {
|
||||
await new Promise<void>((r) => r());
|
||||
const body = render();
|
||||
if (typeof body !== "string") {
|
||||
throw new Error("body is missing");
|
||||
|
||||
Reference in New Issue
Block a user