Parent: #794
Our current code includes a file called promisedMethods.js. With Meteor 3.0 incoming, recent versions of Meteor 2.x have added Meteor.callAsync making this obsolete.
import { Meteor } from 'meteor/meteor';
Meteor.callPromise = function (method, ...args) {
return new Promise(function (resolve, reject) {
Meteor.call(method, ...args, (error, result) => {
if (error) {
reject(error);
}
resolve(result);
});
});
};
Parent: #794 Our current code includes a file called promisedMethods.js. With Meteor 3.0 incoming, recent versions of Meteor 2.x have added
Meteor.callAsync
making this obsolete.