fix: remove Data from FreshContext (#2473)

This is now only on `PageProps`.
This commit is contained in:
Luca Casonato
2024-05-31 13:50:28 +02:00
committed by GitHub
parent dc283a137b
commit 8d85945da6
16 changed files with 131 additions and 124 deletions
+2 -5
View File
@@ -205,21 +205,18 @@ export class App<State> {
const { params, handlers } = matched;
const ctx = new FreshReqContext<State>(
req,
conn,
params,
this.config,
next,
this.#islandRegistry,
this.#buildCache!,
conn,
);
ctx.params = params;
try {
if (handlers.length === 1 && handlers[0].length === 1) {
return handlers[0][0](ctx);
}
ctx.next = next;
return await runMiddlewares(handlers, ctx);
} catch (err) {
if (err instanceof HttpError) {