Migration Async

From the documentation it seems that I can do a find and replace.

Find all Meteor.call(‘my-method’, arg1, arg2, function(err, res){})

Replace by : Meteor.applyAsync(‘my-method-async’, arg1, arg2, function(err, res){})

Is this valid ?

This seems faster than what I am doing now :

Meteor.callAsync(‘my-method-async’, arg1, arg2).then(res)(function(err, res){}))


Correct me if I was wrong: I don’t think you need to change anything because you has a callback function already.
The case you must change is calling without callback function. e.g:
const someVar = Meteor.call('my-method', arg1, arg2)
const someVar = await Meteor.callAsync('my-method', arg1, arg2)

I don’t understand. In the documentation there is no example of callAsync with a callback.
On the client :
Meteor.callAsync(‘my-async-method’, arg1, function(err, res){})
will work ?
Or do I need the .then ?

1 Like

Just keep it as: Meteor.call(‘my-async-method’, arg1, function(err, res){})