Skip to content

Commit

Permalink
Rename arg
Browse files Browse the repository at this point in the history
  • Loading branch information
timonson committed Jul 1, 2022
1 parent f2c79e6 commit d86bd6c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,14 @@ export function createRoute(...methods: Method[]) {
* ```
*/
export function createHandler<C extends Context, S>(
contextClass: new (request: Request, connInfo: ConnInfo, state?: S) => C,
Context: new (request: Request, connInfo: ConnInfo, state?: S) => C,
state?: S,
) {
return (...mainHandler: CtxHandler<C>[]) =>
(...catchHandler: CtxHandler<C>[]) =>
(...finallyHandler: CtxHandler<C>[]) =>
async (request: Request, connInfo: ConnInfo): Promise<Response> => {
const ctx = new contextClass(request, connInfo, state);
const ctx = new Context(request, connInfo, state);
try {
await (compose(...mainHandler)(ctx));
} catch (caught) {
Expand Down

0 comments on commit d86bd6c

Please sign in to comment.