fix(core): align defineFn() with previous definition (#3043)
https://github.com/denoland/fresh/blob/990357629e50ef123e5b5ee2b80c250be867534f/src/server/defines.ts#L13-L16 Closes #3042
This commit is contained in:
+9
-3
@@ -1,4 +1,4 @@
|
||||
import type { VNode } from "preact";
|
||||
import type { ComponentChildren } from "preact";
|
||||
import type { FreshContext } from "./context.ts";
|
||||
import type { HandlerFn, RouteHandler } from "./handlers.ts";
|
||||
|
||||
@@ -46,10 +46,16 @@ export type Handler<T = any, State = Record<string, unknown>> = HandlerFn<
|
||||
function defineFn<State>(
|
||||
fn: (
|
||||
ctx: FreshContext<State>,
|
||||
) => Response | VNode | null | Promise<Response | VNode | null>,
|
||||
) =>
|
||||
| ComponentChildren
|
||||
| Response
|
||||
| Promise<Response | ComponentChildren>,
|
||||
): (
|
||||
ctx: FreshContext<State>,
|
||||
) => Response | VNode | null | Promise<Response | VNode | null> {
|
||||
) =>
|
||||
| ComponentChildren
|
||||
| Response
|
||||
| Promise<Response | ComponentChildren> {
|
||||
return fn;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user