Skip to content

Commit 5613d20

Browse files
committed
fix middleware implementation
1 parent e79351b commit 5613d20

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/db/src/events/Middleware.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export function middleware<
1515
>(
1616
hooks: Hook<T, P, A>[],
1717
context: Omit<HookContext<T, P, A>, "next">,
18-
impl: () => ReturnType<HookMethods<T, P>[A]>
18+
impl: () => ReturnType<HookMethods<T, P>[A]> | Awaited<ReturnType<HookMethods<T, P>[A]>>
1919
): HookReturn<T, P, A> | Promise<HookReturn<T, P, A>>;
2020

2121
/**
@@ -43,7 +43,7 @@ export function middleware<
4343
>(
4444
hooksOrTable: Hook<T, P, A>[] | Table<T, P>,
4545
context: Omit<HookContext<T, P, A>, "next" | "table"> & { table?: string },
46-
impl: () => ReturnType<HookMethods<T, P>[A]>
46+
impl: () => ReturnType<HookMethods<T, P>[A]> | Awaited<ReturnType<HookMethods<T, P>[A]>>
4747
): HookReturn<T, P, A> | Promise<HookReturn<T, P, A>> {
4848
let contextTable = context.table;
4949
let hooks: Hook<T, P, A>[];

0 commit comments

Comments
 (0)