相关疑难解决方法(0)

Meteor wrapAsync语法

我如何使用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同步运行这两个函数,但我得到undefinedconsole.log(getGroup);哪个shuold只返回一个对象.

synchronous meteor

5
推荐指数
1
解决办法
3536
查看次数

标签 统计

meteor ×1

synchronous ×1