There is an existing API that I'd rather not change that gets the connection to a database. The signature looks like
getDBConnection(function(error, DBConnection) {
// do biz logic
});
There is another variable that I want to use within getDBConnection
var foo; // actually has some value i want
getDBConnection(function(error, DBConnection) {
// foo = undefined
});
But foo is undefined in the getDBConnection callback. Is there somethign I can do to have access to Foo within getDBConnection?
via Crystal
No comments:
Post a Comment