Remove type generic from packages/middleware
This commit is contained in:
parent
ee29307e97
commit
4810ecf611
@ -1,3 +1,3 @@
|
||||
import { Context } from './Context'
|
||||
|
||||
export type Middleware = <C extends Context>(ctx: C) => unknown
|
||||
export type Middleware = (ctx: Context) => unknown
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { Middleware } from './Middleware'
|
||||
import { Context } from './Context'
|
||||
|
||||
export const createMiddleware =
|
||||
<C extends Context = Context>(fn: (ctx: C) => unknown) => async (ctx: C) => {
|
||||
export const createMiddleware = (fn: Middleware) => async (ctx: Context) => {
|
||||
await fn(ctx)
|
||||
return undefined
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user