Remove type generic from packages/middleware

This commit is contained in:
Jerko Steiner 2019-09-27 10:25:52 +07:00
parent ee29307e97
commit 4810ecf611
2 changed files with 3 additions and 3 deletions

View File

@ -1,3 +1,3 @@
import { Context } from './Context'
export type Middleware = <C extends Context>(ctx: C) => unknown
export type Middleware = (ctx: Context) => unknown

View File

@ -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
}