The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
Rocket.Chat/packages/rocketchat-lib/client/lib/callMethod.js

15 lines
465 B

/**
* Wraps a Meteor method into a Promise.
* This is particularly useful for creating information dialogs after execution of a Meteor method
* @param {The Meteor method to be calls} method
* @param {the method's parameters} params
*/
export const call = (method, ...params) => new Promise((resolve, reject) => {
Meteor.call(method, ...params, (err, result) => {
if (err) {
handleError(err);
return reject(err);
}
return resolve(result);
});
});