mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-21 05:20:24 +08:00
17 lines
449 B
TypeScript
17 lines
449 B
TypeScript
|
|
import compose = require('koa-compose');
|
|
|
|
var fn1: compose.Middleware = function(context: any, next: () => Promise<void>): Promise<any> {
|
|
return Promise
|
|
.resolve(console.log('in fn1'))
|
|
.then(() => next());
|
|
};
|
|
|
|
var fn2: compose.Middleware = function(context: any, next: () => Promise<void>): Promise<any> {
|
|
return Promise
|
|
.resolve(console.log('in fn2'))
|
|
.then(() => next());
|
|
};
|
|
|
|
|
|
var fn = compose([fn1, fn2]); |