I have simple class like this:
module.exports = class MyClass {
function middleware() {
console.log('call me before')
}
function a() {
}
function b() {
}
function c() {
}
}
So Idea is, when someone call function a, b, c I want call middleware before execute a, b, c. How can I do it?
So, I can put middleware() to each function, but I want some dynamic way how to do this.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…