updated promises functionality

This commit is contained in:
Theodor Diaconu 2016-11-30 14:01:38 +02:00
parent 401bd0e9ba
commit a32920d957
3 changed files with 3 additions and 6 deletions

View file

@ -152,10 +152,7 @@ export default class Exposure {
}; };
Meteor.methods({ Meteor.methods({
[this.name]: methodBody, [this.name]: methodBody
[this.name + '_async']: async function(...args) {
return methodBody.call(this, ...args);
}
}); });
} }

View file

@ -42,7 +42,7 @@ export default class extends Base {
throw new Meteor.Error('This query is reactive, meaning you cannot use promises to fetch the data.'); throw new Meteor.Error('This query is reactive, meaning you cannot use promises to fetch the data.');
} }
return await callWithPromise(this.name + '_async', prepareForProcess(this.body, this.params)); return await callWithPromise(this.name, prepareForProcess(this.body, this.params));
} }
/** /**

View file

@ -42,7 +42,7 @@ export default class Query extends Base {
throw new Meteor.Error('This query is reactive, meaning you cannot use promises to fetch the data.'); throw new Meteor.Error('This query is reactive, meaning you cannot use promises to fetch the data.');
} }
return await callWithPromise(this.name + '_async', prepareForProcess(this.body, this.params)); return await callWithPromise(this.name, prepareForProcess(this.body, this.params));
} }
/** /**