How to set variable before callback is called?
- by user1995327
I'm trying to design a webpage...
I have a function that I call get all info needed for an idividuals home page. A snippet of the codes is:
exports.getHomePageData = function(userId, cb) {
var pageData = {};
pageData.userFullName = dbUtil.findNameByUserId(userId, function(err){
if (err) cb(err);
});
pageData.classes =…