【发布时间】:2015-12-21 00:22:52
【问题描述】:
如何使用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;
}
我想同步运行这两个Meteor.call函数,但我在console.log(getGroup);上得到undefined,它应该只返回一个对象。
【问题讨论】:
标签: meteor synchronous