Suppose that I have this module:
module.exports = {
functionA: function (err, callback, res) {
// some data process
callback(err, this.functionB, res)
},
functionB: function(){
//some data process
}
}
And on my main function I have got a call like:
functionA(err, functionC, res)
This is giving me undefined for callback(which is functionB) in functionC
, like detailed below:
functionC: function (err, callback, res) {
callback(/*some parameter */) //err: callback is undefined
}
I have tried updating functionA
with :
functionA: function (err, callback, res) {
// some data process
callback(err, this.functionB, res)
}
But that way I get functionB
is not defined.