Compose middleware.
$ npm i @fibjs/compose --save
const compose = require('@fibjs/compose');
const middleware = [
(ctx, next) => {
next();
},
(ctx, next) => {
next();
},
];
const fn = compose(middleware);
const ctx = {
num: 1,
};
fn(ctx)(ctx, (ctx) => {});
Please open an issue here.