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
+3 -3
View File
@@ -1,4 +1,4 @@
import type { FreshContext } from "../context.ts";
import type { FreshContext, FreshReqContext } from "../context.ts";
import type { App as _App } from "../app.ts";
/**
@@ -71,7 +71,7 @@ import type { App as _App } from "../app.ts";
* ```
*/
export type MiddlewareFn<State> = (
ctx: FreshContext<unknown, State>,
ctx: FreshContext<State>,
) => Response | Promise<Response>;
/**
@@ -82,7 +82,7 @@ export type Middleware<State> = MiddlewareFn<State> | MiddlewareFn<State>[];
export function runMiddlewares<State>(
middlewares: MiddlewareFn<State>[][],
ctx: FreshContext<unknown, State>,
ctx: FreshReqContext<State>,
): Promise<Response> {
let fn = ctx.next;
let i = middlewares.length;