我如何使用Meteor wrapAsync?
以下是我想要做的事情
if (tempTreatment.groupId === undefined) {
// create new group
Meteor.wrapAsync(Meteor.call('createTreatmentGroup', salon, tempTreatment.groupName, tempTreatment.groupName));
// get group id
var getGroup = Meteor.wrapAsync(Meteor.call('getTreatmentGroup', salon, tempTreatment.groupName));
console.log(getGroup);
tempTreatment.groupId = getGroup._id;
}
Run Code Online (Sandbox Code Playgroud)
我想Meteor.call同步运行这两个函数,但我得到undefined了console.log(getGroup);哪个shuold只返回一个对象.