Is there a way to retrieve the value returned by an asynchronous callback in the client-side of Meteor before the stack continues executing? Here is code snippet as an example:
var result=function(str){
Meteor.call("getSearch",str,function(err,res){
if (err)
throw new Error(err.message);
else
return res
});
};
var final=result(text);
console.log(final);
Any suggestions on how I can obtain the value of final
before it is displayed? Thank you.